summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* More external API cleanupmore-api-tweaksVicent Marti2012-11-1711-76/+60
|
* Fix a couple of warningsMichael Schubert2012-11-182-3/+3
|
* reflog: make entry_byindex() and drop() git compliantnulltoken2012-11-173-23/+28
| | | | | Passing 0 as the index now retrieves the most recent entry instead of the oldest one.
* config: Opening a nonexistent file returns ENOTFOUNDnulltoken2012-11-172-7/+42
|
* config: Make git_config_file__ondisk() internalnulltoken2012-11-171-0/+13
|
* repo: ensure is_empty() checks there are no refsnulltoken2012-11-171-20/+31
|
* tag: rename git_tag_type to git_tag_target_typenulltoken2012-11-171-1/+1
|
* Fix MSVC compilation warningsnulltoken2012-11-171-5/+5
|
* Merge pull request #1075 from carlosmn/alternates-recurseVicent Martí2012-11-161-8/+20
|\ | | | | odb: recursively load alternates
| * odb: recursively load alternatesCarlos Martín Nieto2012-11-161-8/+20
| | | | | | | | The maximum depth is 5, like in git
* | Merge pull request #1071 from arrbee/alternate-fix-strcmpScott J. Goldman2012-11-1511-68/+139
|\ \ | | | | | | Win32 fixes for diff/checkout/reset
| * | Add POSIX compat lstat() variant for win32Russell Belfer2012-11-147-60/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing p_lstat implementation on win32 is not quite POSIX compliant when setting errno to ENOTDIR. This adds an option to make is be compliant so that code (such as checkout) that cares to have separate behavior for ENOTDIR can use it portably. This also contains a couple of other minor cleanups in the posix_w32.c implementations to avoid unnecessary work.
| * | Create internal strcmp variants for function ptrsRussell Belfer2012-11-144-8/+43
| | | | | | | | | | | | | | | | | | Using the builtin strcmp and strcasecmp as function pointers is problematic on win32. This adds internal implementations and divorces us from the platform linkage.
* | | Fix -Wmaybe-uninitialized warningMichael Schubert2012-11-161-1/+1
| | |
* | | Merge pull request #1074 from edubart/ignore_diff_filemodeVicent Martí2012-11-151-0/+3
|\ \ \ | | | | | | | | Add option to ignore file mode in diffs
| * | | Add option to ignore file mode in diffsEduardo Bart2012-11-151-0/+3
| | |/ | |/|
* | | Add explicit git_index ptr to diff and checkoutRussell Belfer2012-11-147-38/+47
| | | | | | | | | | | | | | | | | | | | | | | | A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
* | | Add iterator for git_index objectRussell Belfer2012-11-147-24/+77
| | | | | | | | | | | | | | | | | | The index iterator could previously only be created from a repo object, but this allows creating an iterator from a `git_index` object instead (while keeping, though renaming, the old function).
* | | Fix diff API to better parameter orderRussell Belfer2012-11-145-86/+50
|/ / | | | | | | | | The diff API is not in the parameter order one would expect from other libgit2 APIs. This fixes that.
* | Slightly different valgrind fixCarlos Martín Nieto2012-11-131-3/+1
| | | | | | | | | | Allocate with calloc rather than conditionally memsetting a specific part of the struct later on.
* | Fix a few valgrind errorsCarlos Martín Nieto2012-11-133-2/+5
|/
* Merge pull request #1068 from carlosmn/config-empty-valueVicent Martí2012-11-134-24/+35
|\ | | | | Deal with empty and nonexsitent values in config
| * config: return an emtpy string when there is no valueCarlos Martín Nieto2012-11-132-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Returning NULL for the string when we haven't signaled an error condition is counter-intuitive and causes unnecessary edge cases. Return an empty string when asking for a string value for a configuration variable such as '[section] var' to avoid these edge cases. If the distinction between no value and an empty value is needed, this can be retrieved from the entry directly. As a side-effect, this change stops the int parsing functions from segfaulting on such a variable.
| * config: distinguish between a lone variable name and one without rhsCarlos Martín Nieto2012-11-133-9/+8
| | | | | | | | | | | | '[section] variable' and '[section] variable =' behave differently when parsed as booleans, so we need to store that distinction internally.
* | http: UnrustleVicent Marti2012-11-131-4/+1
| |
* | Merge pull request #1016 from arrbee/fix-checkout-dir-removalVicent Martí2012-11-1324-525/+1166
|\ \ | |/ |/| Update checkout with new strategies & behavior
| * Fix warnings and valgrind issuesRussell Belfer2012-11-094-9/+15
| | | | | | | | | | This fixes some various warnings that showed up in Travis and a couple uses of uninitialized memory and one memory leak.
| * Fix various cross-platform build issuesRussell Belfer2012-11-094-24/+24
| | | | | | | | | | | | This fixes a number of warnings and problems with cross-platform builds. Among other things, it's not safe to name a member of a structure "strcmp" because that may be #defined.
| * fix regression in diff with submodule oidRussell Belfer2012-11-091-9/+8
| |
| * Rework checkout with new strategy optionsRussell Belfer2012-11-098-163/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a major reworking of checkout strategy options. The checkout code is now sensitive to the contents of the HEAD tree and the new options allow you to update the working tree so that it will match the index content only when it previously matched the contents of the HEAD. This allows you to, for example, to distinguish between removing files that are in the HEAD but not in the index, vs just removing all untracked files. Because of various corner cases that arise, etc., this required some additional capabilities in rmdir and other utility functions. This includes the beginnings of an implementation of code to read a partial tree into the index based on a pathspec, but that is not enabled because of the possibility of creating conflicting index entries.
| * Some diff refactorings to help code reuseRussell Belfer2012-11-0911-127/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some diff functions that are useful in a rewritten checkout and this lays some groundwork for that. This contains three main things: 1. Share the function diff uses to calculate the OID for a file in the working directory (now named `git_diff__oid_for_file` 2. Add a `git_diff__paired_foreach` function to iterator over two diff lists concurrently. Convert status to use it. 3. Move all the string/prefix/index entry comparisons into function pointers inside the `git_diff_list` object so they can be switched between case sensitive and insensitive versions. This makes them easier to reuse in various functions without replicating logic. As part of this, move a couple of index functions out of diff.c and into index.c.
| * Move pathspec code in separate filesRussell Belfer2012-11-093-135/+220
| | | | | | | | | | | | | | Diff uses a `git_strarray` of path specs to represent a subset of all files to be processed. It is useful to be able to reuse this filtering in other places outside diff, so I've moved it into a standalone set of utilities.
| * Make iterator ignore eval lazyRussell Belfer2012-11-091-10/+17
| | | | | | | | | | | | | | | | This makes it so that the check if a file is ignored will be deferred until requested on the workdir iterator, instead of aggressively evaluating the ignore rules for each entry. This should improve performance because there will be no need to check ignore rules for files that are already in the index.
| * Fix checkout behavior when its hands are tiedRussell Belfer2012-11-091-119/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So, @nulltoken created a failing test case for checkout that proved to be particularly daunting. If checkout is given only a very limited strategy mask (e.g. just GIT_CHECKOUT_CREATE_MISSING) then it is possible for typechange/rename modifications to leave it unable to complete the request. That's okay, but the existing code did not have enough information not to generate an error (at least for tree/blob conflicts). This led me to a significant reorganization of the code to handle the failing case, but it has three benefits: 1. The test case is handled correctly (I think) 2. The new code should actually be much faster than the old code since I decided to make checkout aware of diff list internals. 3. The progress value accuracy is hugely increased since I added a fourth pass which calculates exactly what work needs to be done before doing anything.
| * Extensions to rmdir and mkdir utilitiesRussell Belfer2012-11-096-60/+134
| | | | | | | | | | | | | | | | | | | | | | * Rework GIT_DIRREMOVAL values to GIT_RMDIR flags, allowing combinations of flags * Add GIT_RMDIR_EMPTY_PARENTS flag to remove parent dirs that are left empty after removal * Add GIT_MKDIR_VERIFY_DIR to give an error if item is a file, not a dir (previously an EEXISTS error was ignored, even for files) and enable this flag for git_futils_mkpath2file call * Improve accuracy of error messages from git_futils_mkdir
* | config: rename get_config_entry -> config_entryCarlos Martín Nieto2012-11-131-1/+1
| | | | | | | | | | We're already in the git_config namespace, there is no need to repeat it.
* | filebuf now has a git_hash_ctx instead of a ctx*Edward Thomson2012-11-132-18/+17
| |
* | unload dll / destroy hash ctxs at shutdownEdward Thomson2012-11-137-0/+37
| |
* | move hash library func ptrs to global globalEdward Thomson2012-11-137-55/+95
| |
* | Remove git_hash_ctx_new - callers now _ctx_init()Edward Thomson2012-11-1314-167/+82
| |
* | Win32 CryptoAPI and CNG support for SHA1Edward Thomson2012-11-1315-126/+666
| |
* | Merge pull request #1065 from nulltoken/fix/memory-leakBen Straub2012-11-131-0/+1
|\ \ | | | | | | Fix memory leaks
| * | local: fix memory leaknulltoken2012-11-131-0/+1
| | |
* | | Remove unused variablesMichael Schubert2012-11-131-1/+0
|/ /
* | Merge remote-tracking branch 'ben/local-transport' into developmentVicent Marti2012-11-121-7/+135
|\ \
| * | Remove unnecessary progress logicBen Straub2012-11-121-4/+0
| | | | | | | | | | | | | | | The indexer handles this better than the fetch logic does.
| * | Fix error checkBen Straub2012-11-121-1/+1
| | |
| * | Avoid copying duplicate commitsBen Straub2012-11-091-7/+8
| | |
| * | Implement local transport's fetchBen Straub2012-11-091-7/+138
| | |
* | | repository: Refine repository_head() error reportnulltoken2012-11-122-2/+12
| | |