summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* submodule: check alloc and name presenseNikolai Vladimirov2013-08-051-1/+4
|
* Fix possible double closeSven Strickroth2013-07-271-0/+1
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Close p->mwf.fd only if necessarySven Strickroth2013-07-251-2/+3
| | | | | | This fixes a regression introduced in revision 9d2f841a5d39fc25ce722a3904f6ebc9aa112222. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Clean up some documentationCarlos Martín Nieto2013-07-233-10/+6
| | | | clang's docparser highlighted these.
* Fix warning message about mismatched typesRussell Belfer2013-07-221-5/+3
|
* Use pool for loose refdb string allocationsRussell Belfer2013-07-221-22/+33
| | | | | | | | | | | Instead of using lots of strdup calls, this adds a memory pool to the loose refs iteration code and uses it for keeping track of the loose refs array. Memory usage could probably be reduced even further by eliminating the vector and just scanning by adding the strlen of each ref, but that would be a more intrusive changes. This also updates the error handling to be more thorough about checking for failed allocations, etc.
* git_reference_next_name must match git_reference_nextRussell Belfer2013-07-221-3/+13
| | | | | | | | | | The git_reference_next API silently skips invalid references when scanning the loose refs. The git_reference_next_name API should skip the same ones even though it isn't creating the reference object. This adds a test with a an invalid loose reference and makes sure that both APIs skip the same entries and generate the same results.
* Merge pull request #1726 from crazymaster/developmentBen Straub2013-07-191-1/+1
|\ | | | | git_buf_text_gather_stats doesn't work for multi-byte characters
| * Fix the initial linecrazymaster2013-07-151-23/+18
| |
| * Fix gather_statscrazymaster2013-07-141-18/+23
| |
* | Merge pull request #1722 from libgit2/ntk/fix/issue_1722Ben Straub2013-07-171-0/+13
|\ \ | | | | | | git_revparse_ext: should return a NULL reference when the revparse expression doesn't lead to a reference
| * | revparse: Don't return a reference when asked for a git objectnulltoken2013-07-131-0/+13
| |/ | | | | | | Fix #1722
* | don't include ignored as rename candidatesEdward Thomson2013-07-171-1/+3
| |
* | Merge pull request #1728 from ivoire/small_fixesVicent Martí2013-07-157-10/+23
|\ \ | | | | | | Small fixes
| * | Fix some more memory leaks in error pathRémi Duraffort2013-07-152-1/+4
| | |
| * | pack: fix memory leak in error pathRémi Duraffort2013-07-152-2/+6
| | |
| * | index: fix potential memory leaksRémi Duraffort2013-07-152-4/+10
| | |
| * | repository: clarify assignment and test orderRémi Duraffort2013-07-151-3/+3
| |/
* | Add `git_remote_owner`Etienne Samson2013-07-151-0/+6
|/
* submodule: Fix memory leaksnulltoken2013-07-131-1/+2
|
* preload configuration pathsEdward Thomson2013-07-113-5/+25
|
* Fix warnings on Win64Russell Belfer2013-07-112-2/+3
|
* Update git__swap thread helperRussell Belfer2013-07-111-14/+43
| | | | | | | | | | | | | This makes git__swap use the __sync_lock_test_and_set primitive with GCC and the InterlockedExchangePointer primitive with MSVC. Previously is used compare_and_swap in a way that was probably unintuitive for most thinking (i.e. it could fail to swap in the value if another thread raced in). Now it will always succeed and the last thread to run in a race will win instead of the first thread. This also fixes up a little confusion between volatile void ** and void * volatile * that came up with the Win32 compiler.
* Untracked directories with .git should be ignoredRussell Belfer2013-07-101-2/+12
| | | | | | | | | | | | | | | | | This restores a behavior that was accidentally lost during some diff refactoring where an untracked directory that contains a .git item should be treated as IGNORED, not as UNTRACKED. The submodule code already detects this, but the diff code was not handling the scenario right. This also updates a number of existing tests that were actually exercising the behavior but did not have the right expectations in place. It actually makes the new `test_diff_submodules__diff_ignore_options` test feel much better because the "not-a-submodule" entries are now ignored instead of showing up as untracked items. Fixes #1697
* Clean up left over alloc changeRussell Belfer2013-07-101-1/+1
|
* Add ignore_submodules to diff optionsRussell Belfer2013-07-103-70/+127
| | | | | | | | | | | | | | | | | | | | This adds correct support for an equivalent to --ignore-submodules in diff, where an actual ignore value can be passed to diff to override the per submodule settings in the configuration. This required tweaking the constants for ignore values so that zero would not be used and could represent an unset option to the diff. This was an opportunity to move the submodule values into include/git2/types.h and to rename the poorly named DEFAULT values for ignore and update constants to RESET instead. Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL (which is actually a minor change from the old behavior in that submodules will now be treated as UNMODIFIED deltas instead of being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED). This includes tests for the various new settings.
* Update diff to new internal submodule status APIRussell Belfer2013-07-101-6/+8
| | | | | | | Submodules now expose an internal status API that allows diff to get back the OID values from the submodule very easily and also to avoiding caching issues and to override the ignore setting for the submodule.
* Submodule status improvementsRussell Belfer2013-07-102-321/+333
| | | | | | | | | | | | | | | This fixes the way that submodule status is checked to bypass just about all of the caching in the submodule object. Based on the ignore value, it will try to do the minimum work necessary to find the current status of the submodule - but it will actually go to disk to get all of the current values. This also removes the custom refcounting stuff in favor of the common git_refcount style. Right now, it is still for internal purposes only, but it should make it easier to add true submodule refcounting in the future with a public git_submodule_free call that will allow bindings not to worry about the submodule object getting freed from underneath them.
* Add BARE option to git_repository_open_extRussell Belfer2013-07-101-6/+9
| | | | | | | | | | | This adds a BARE option to git_repository_open_ext which allows a fast open path that still knows how to read gitlinks and to search for the actual .git directory from a subdirectory. `git_repository_open_bare` is still simpler and faster, but having a gitlink aware fast open is very useful for submodules where we want to quickly be able to peek at the HEAD and index data without doing any other meaningful repo operations.
* Add accessors for refcount valueRussell Belfer2013-07-102-0/+8
|
* Add timestamp check to submodule statusRussell Belfer2013-07-102-22/+68
| | | | | | | | This is probably not the final form of this change, but this is a preliminary version of checking a timestamp to see if the cached working directory HEAD OID matches the current. Right now, this uses the timestamp on the index and is, like most of our timestamp checking, subject to having only second accuracy.
* Add API to get path to index fileRussell Belfer2013-07-101-0/+6
|
* bitvec: Simplify the bit vector codeVicent Marti2013-07-101-39/+22
|
* Add git_pathspec_match_diff APIRussell Belfer2013-07-105-77/+263
| | | | | | | | | | | | | | | | | | This adds an additional pathspec API that will match a pathspec against a diff object. This is convenient if you want to handle renames (so you need the whole diff and can't use the pathspec constraint built into the diff API) but still want to tell if the diff had any files that matched the pathspec. When the pathspec is matched against a diff, instead of keeping a list of filenames that matched, instead the API keeps the list of git_diff_deltas that matched and they can be retrieved via a new API git_pathspec_match_list_diff_entry. There are a couple of other minor API extensions here that were mostly for the sake of convenience and to reduce dependencies on knowing the internal data structure between files inside the library.
* Basic bit vectorRussell Belfer2013-07-101-0/+92
| | | | | | | | | | | This is a simple bit vector object that is not resizable after the initial allocation but can be of arbitrary size. It will keep the bti vector entirely on the stack for vectors 64 bits or less, and will allocate the vector on the heap for larger sizes. The API is uniform regardless of storage location. This is very basic right now and all the APIs are inline functions, but it is useful for storing an array of boolean values.
* Convert commit->parent_ids to git_array_tRussell Belfer2013-07-103-24/+12
| | | | | | | | | This converts the array of parent SHAs from a git_vector where each SHA has to be separately allocated to a git_array_t where all the SHAs can be kept in one block. Since the two collections have almost identical APIs, there isn't much involved in making the change. I did add an API to git_array_t so that it could be allocated at a precise initial size.
* Fix example/log.c pathspec handling of mergesRussell Belfer2013-07-101-8/+13
| | | | | | | This fixes the way the example log program decides if a merge commit should be shown when a pathspec is given. Also makes it easier to use the pathspec API to just check "does a tree match anything in the pathspec" without allocating a match list.
* Add raw header access to commit APIRussell Belfer2013-07-102-10/+38
|
* Add public API for pathspec matchingRussell Belfer2013-07-106-96/+467
| | | | | | | | | | | | | | | This adds a new public API for compiling pathspecs and matching them against the working directory, the index, or a tree from the repository. This also reworks the pathspec internals to allow the sharing of code between the existing internal usage of pathspec matching and the new external API. While this is working and the new API is ready for discussion, I think there is still an incorrect behavior in which patterns are always matched against the full path of an entry without taking the subdirectories into account (so "s*" will match "subdir/file" even though it wouldn't with core Git). Further enhancements are coming, but this was a good place to take a functional snapshot.
* Merge pull request #1705 from arrbee/avoid-index-double-freeVicent Martí2013-07-101-40/+34
|\ | | | | Try harder not to double free index entries
| * Be more thread aware with some index updatesRussell Belfer2013-07-031-40/+34
| | | | | | | | | | | | | | | | The index isn't really thread safe for the most part, but we can easily be more careful and avoid double frees and the like, which are serious problems (as opposed to a lookup which might return the incorrect value but if the index in being updated, that is much harder to avoid).
* | trivial whitespace fixupRussell Belfer2013-07-101-1/+1
| |
* | Bring SSH error reporting up to base standardsRussell Belfer2013-07-102-81/+73
| | | | | | | | | | | | | | The SSH error checking and reporting could still be further improved by using the libssh2 native methods to get error info, but at least this ensures that all error codes are checked and translated into libgit2 error messages.
* | Merge branch 'ssh-cred-fix' of tiennou/libgit2Russell Belfer2013-07-101-25/+35
|\ \ | | | | | | | | | | | | Conflicts: src/transports/ssh.c
| * | Tab indent.Etienne Samson2013-07-101-90/+92
| | |
| * | Add some missing error messages.Etienne Samson2013-07-101-9/+16
| | |
| * | Fix a probable leak.Etienne Samson2013-07-031-1/+1
| | |
| * | Fix a crash if git_remote_set_cred_acquire_cb wasn't called before connecting.Etienne Samson2013-07-031-2/+4
| | | | | | | | | | | | Fixes #1700.
* | | Merge pull request #1704 from arrbee/kill-status-index-then-workdirVicent Martí2013-07-092-14/+5
|\ \ \ | | | | | | | | Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR option
| * | | Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR optionRussell Belfer2013-07-032-14/+5
| |/ / | | | | | | | | | | | | | | | This option serves no benefit now that the git_status_list API is available. It was of questionable value before and now it would just be a bad idea to use it rather than the indexed API.