Commit Graph

3381 Commits

Author SHA1 Message Date
Philip Kelley
c49d328cf4 Expose a malloc function to 3rd party ODB backends 2012-08-27 09:59:13 -04:00
nulltoken
d1445b7528 branch: reduce code duplication 2012-08-27 15:38:38 +02:00
Michael Schubert
4e323ef0a8 revwalk: refuse push of non-commit objects
Check the type of the pushed object immediately instead of starting the
walk and failing in between.
2012-08-27 11:52:32 +02:00
nulltoken
2e0c881670 refs: expose git_reference_normalize_name() 2012-08-27 08:41:26 +02:00
Vicent Marti
1c947daa80 branch: Change git_branch_delete to take a ref 2012-08-26 18:00:10 -07:00
Vicent Marti
17f7bde2f7 posix: Always set a default mapping mode 2012-08-26 18:00:10 -07:00
Carlos Martín Nieto
2b175ca972 indexer: kill git_indexer_stats.data_received
It's not really needed with the current code as we have EOS and the
sideband's flush to tell us we're done.

Keep the distinction between processed and received objects.
2012-08-26 00:42:28 +02:00
Carlos Martín Nieto
cc1d85d1da http: increase buffer side to deal with side-band-64k
This poor transport was forgotten in the recent sideband support.
2012-08-25 23:32:19 +02:00
Carlos Martín Nieto
7a57ae5478 indexer: don't segfault when freeing an unused indexer
Make sure that idx->pack isn't NULL before trying to free resources
under it.
2012-08-25 23:31:29 +02:00
Vicent Martí
8238401ccb Merge pull request #896 from ben/revparse-ambiguous
Revparse: GIT_EAMBIGUOUS
2012-08-25 11:37:23 -07:00
Ben Straub
c9de8611d6 Revparse: GIT_EAMBIGUOUS
Revparse now returns EAMBIGUOUS if the the spec
doesn't match any refs/tags, and is <4 characters.
2012-08-25 09:56:20 -07:00
Vicent Martí
b7e8827b8b Merge pull request #895 from carlosmn/sideband
Add sideband support
2012-08-24 16:29:01 -07:00
Vicent Martí
09fad50696 Merge pull request #852 from arrbee/submodule-extensions
Submodule extensions
2012-08-24 15:45:13 -07:00
Vicent Martí
091c742af9 Merge pull request #876 from arrbee/new-config-locations
new config file locations and defaults
2012-08-24 15:43:19 -07:00
Russell Belfer
7fbca880aa Support new config locations
As of git v1.7.12, $HOME/.config/git/ is supported as a new
location for "config", "attributes", and "ignore" files.
2012-08-24 14:32:45 -07:00
Russell Belfer
07c06f7a83 Fix memory leak in cp_r 2012-08-24 14:24:33 -07:00
Russell Belfer
1168410426 Fix crash with adding internal ignores
Depending on what you had done before adding new items to the
internal ignores list, it was possible for the cache of ignore
data to be uninitialized.
2012-08-24 13:41:45 -07:00
Russell Belfer
97a17e4e9f Fix valgrind warnings and spurious error messages
Just clean up valgrind warnings about uninitialized memory
and also clear out errno in some cases where it results in
a false error message being generated at a later point.
2012-08-24 12:19:22 -07:00
Carlos Martín Nieto
0a1db746fb examples: add progress output to fetch 2012-08-24 20:29:45 +02:00
Carlos Martín Nieto
e03e71da56 network: add sideband support
This lets us notify the user of what the remote end is doing while we
wait for it to start sending us the packfile.
2012-08-24 20:29:39 +02:00
Russell Belfer
5f4a61aea8 Working implementation of git_submodule_status
This is a big redesign of the git_submodule_status API and the
implementation of the redesigned API.  It also fixes a number of
bugs that I found in other parts of the submodule API while
writing the tests for the status part.

This also fixes a couple of bugs in the iterators that had not
been noticed before - one with iterating when there is a gitlink
(i.e. separate-work-dir) and one where I was treating anything
even vaguely submodule-like as a submodule, more aggressively
than core git does.
2012-08-24 11:00:27 -07:00
Russell Belfer
0c8858de8c Fix valgrind issues and leaks
This fixes up a number of problems flagged by valgrind and also
cleans up the internal `git_submodule` allocation handling
overall with a simpler model.
2012-08-24 11:00:27 -07:00
Russell Belfer
aa13bf05c8 Major submodule rewrite
This replaces the old submodule API with a new extended API that
supports most of the things that can be done with `git submodule`.
2012-08-24 11:00:26 -07:00
Russell Belfer
decff7b4c1 New submodule test data 2012-08-24 11:00:26 -07:00
Russell Belfer
2eb4edf5f2 Fix errors on Win32 with new repo init 2012-08-24 10:48:48 -07:00
Carlos Martín Nieto
bffa852f89 indexer: recognize and mark when all of the packfile has been downloaded
We can't always rely on the network telling us when the download is
finished. Recognize it from the indexer itself.
2012-08-24 19:01:10 +02:00
Vicent Martí
c920e16232 Merge pull request #844 from arrbee/init-extended
Add git_repository_init_ext for power initters
2012-08-23 14:10:47 -07:00
Russell Belfer
e9ca852e4d Fix warnings and merge issues on Win64 2012-08-23 09:20:17 -07:00
Russell Belfer
85bd174626 Some cleanup suggested during review
This cleans up a number of items suggested during code review
with @vmg, including:

* renaming "outside repo" config API to `git_config_open_default`
* killing the `git_config_open_global` API
* removing the `git_` prefix from the static functions in fileops
* removing some unnecessary functionality from the "cp" command
2012-08-22 16:16:42 -07:00
Russell Belfer
b769e936d0 Don't reference stack vars in cleanup callback
If you use the clar cleanup callback function, you can't pass a
reference pointer to a stack allocated variable because when the
cleanup function runs, the stack won't exist anymore.
2012-08-22 16:07:19 -07:00
Russell Belfer
0e26202cd5 fix missing validation and type cast warning 2012-08-22 16:07:19 -07:00
Russell Belfer
ca1b6e5409 Add template dir and set gid to repo init
This extends git_repository_init_ext further with support for
initializing the repository from an external template directory
and with support for the "create shared" type flags that make a
set GID repository directory.

This also adds tests for much of the new functionality to the
existing `repo/init.c` test suite.

Also, this adds a bunch of new utility functions including a
very general purpose `git_futils_mkdir` (with the ability to
make paths and to chmod the paths post-creation) and a file
tree copying function `git_futils_cp_r`.  Also, this includes
some new path functions that were useful to keep the code
simple.
2012-08-22 16:07:19 -07:00
Russell Belfer
662880ca60 Add git_repository_init_ext for power initters
The extended version of repository init adds support for many
of the things that you can do with `git init` and sets up
structures that will make it easier to extend further in the
future.
2012-08-22 16:06:22 -07:00
Russell Belfer
5fdc41e765 Minor bug fixes in diff code
In looking at PR #878, I found a few small bugs in the diff code,
mostly related to work that can be avoided when processing tree-
to-tree diffs that was always being carried out.  This commit has
some small fixes in it.
2012-08-22 13:57:57 -07:00
Vicent Martí
cfda29e382 Merge pull request #891 from arrbee/internal-ignore-api
API for managing in-memory ignore rules
2012-08-22 13:15:14 -07:00
Russell Belfer
2fb4e9b3c5 Wrap up ignore API and add tests
This fills out the ignore API and adds tests.
2012-08-22 11:42:00 -07:00
Russell Belfer
f004c4a8a7 Add public API for internal ignores
This creates a public API for adding to the internal ignores
list, which already existing but was not accessible.

This adds the new default value for core.excludesfile also.
2012-08-21 17:26:39 -07:00
Vicent Martí
697665c0c1 Merge pull request #889 from nulltoken/filemode-enum
Filemode enum
2012-08-21 14:32:09 -07:00
nulltoken
9d7ac675d0 tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode() 2012-08-21 23:15:13 +02:00
nulltoken
a7dbac0b23 filemode: deploy enum usage 2012-08-21 23:15:10 +02:00
nulltoken
d854d59e31 filemode: introduce enum to ease use of attributes 2012-08-21 23:15:08 +02:00
Ben Straub
b2be351aad Win32: test core.autocrlf 2012-08-21 10:55:39 -07:00
Ben Straub
c35881420d Tests: close file handles before asserting
Avoids getting ERROR_SHARING_VIOLATION on win32
and killing the entire clar run.
2012-08-20 20:24:20 -07:00
Vicent Martí
5c27da1f48 Merge pull request #884 from carlosmn/global-windows
Make the memory-window conrol structures global
2012-08-20 12:10:23 -07:00
Carlos Martín Nieto
8cef828d8d Make the memory-window conrol structures global
Up to now, the idea was that the user would do all the operations for
one repository in the same thread. Thus we could have the
memory-mapped window information thread-local and avoid any locking.

This is not practical in a few environments, such as Apple's GCD which
allocates threads arbitrarily or the .NET CLR, where the OS-level
thread can change at any moment.

Make the control structure global and protect it with a mutex so we
don't depend on the thread currently executing the code.
2012-08-20 12:02:52 +02:00
Vicent Martí
6cb64ce34f Merge pull request #879 from nulltoken/deprecated-mode
Handling of 100664 deprecated mode in tree entries
2012-08-19 15:12:43 -07:00
nulltoken
66439b0b1a treebuilder: enhance attributes handling on insertion 2012-08-19 14:11:59 +02:00
nulltoken
a7e3bd9b0f Add deprecated-mode.git test repository 2012-08-19 14:11:57 +02:00
Vicent Martí
f98c32f3fe Merge pull request #778 from ben/clone
Clone
2012-08-19 01:26:06 -07:00
Vicent Martí
1a10fded40 Merge pull request #877 from nulltoken/minor-fixes
Minor fixes
2012-08-15 14:34:49 -07:00