summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* lolXcode.fix-submodule-config-loadingAlan Rogers2013-06-281-1/+1
|
* tabs.Alan Rogers2013-06-281-2/+2
|
* We DO still need load the config from the index apparently.Alan Rogers2013-06-281-1/+2
|
* Don't bail out after failing to read submodule configs.Alan Rogers2013-06-281-4/+2
| | | | | As the config may only exist in only one of (or neither of?) the HEAD or the index.
* Fix bug marking submodule diffs as unmodifiedRussell Belfer2013-06-271-1/+5
| | | | | | | There was a bug where submodules whose HEAD had not been moved were being marked as having an UNMODIFIED delta record instead of being left MODIFIED. This fixes that and fixes the tests to notice if a submodule has been incorrectly marked as UNMODIFIED.
* Merge pull request #1681 from arthurschreiber/patch-1Russell Belfer2013-06-251-1/+1
|\ | | | | Prefer younger merge bases over older ones.
| * Prefer younger merge bases over older ones.Arthur Schreiber2013-06-251-1/+1
| | | | | | git-core prefers younger merge bases over older ones in case that multiple valid merge bases exists.
* | Merge pull request #1678 from arthurschreiber/unbreak-local-ls-after-disconnectRussell Belfer2013-06-251-12/+22
|\ \ | | | | | | Unbreak git_remote_ls on a local transport after disconnecting.
| * | Make sure we don't leak memory again.Arthur Schreiber2013-06-251-0/+7
| | |
| * | Unbreak git_remote_ls on a local transport after disconnecting.Arthur Schreiber2013-06-251-12/+15
| |/
* | Correctly handle junctionsSven Strickroth2013-06-251-0/+3
| | | | | | | | | | | | A junction has S_IFDIR | S_IFLNK set, however, only one makes sense. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | Revert "Work around reparse point stat issues"Sven Strickroth2013-06-251-2/+1
|/ | | | This reverts commit 32c12ea6a9cafd76a746af2e2be9366c95752f5b.
* Fix a leak in the local transport code.Arthur Schreiber2013-06-241-9/+9
|
* Merge pull request #1670 from arrbee/open-cloexecVicent Martí2013-06-243-4/+9
|\ | | | | Add O_CLOEXEC to open calls
| * Add O_CLOEXEC to open callsRussell Belfer2013-06-223-4/+9
| |
* | Merge pull request #1669 from arrbee/fix-index-add-bypathVicent Martí2013-06-242-17/+32
|\ \ | |/ |/| In loose objects backend, constrain mkdir calls to avoid extra mkdirs
| * Work around reparse point stat issuesRussell Belfer2013-06-241-1/+2
| | | | | | | | | | | | | | | | | | In theory, p_stat should never return an S_ISLNK result, but due to the current implementation on Windows with mount points it is possible that it will. For now, work around that by allowing a link in the path to a directory being created. If it is really a problem, then the issue will be caught on the next iteration of the loop, but typically this will be the right thing to do.
| * Constrain mkdir calls to avoid extra mkdirsRussell Belfer2013-06-221-16/+30
| | | | | | | | | | | | | | | | | | | | | | This updates the calls that make the subdirectories for objects to use a base directory above which git_futils_mkdir won't walk any higher. This prevents attempts to mkdir all the way up to the root of the filesystem. Also, this moves the objects_dir into the loose backend structure and removes the separate allocation, plus does some preformatting of the objects_dir value to guarantee a trailing slash, etc.
* | Do not redefine WC_ERR_INVALID_CHARSSven Strickroth2013-06-231-0/+2
|/ | | | | | WC_ERR_INVALID_CHARS might be already defined by the Windows SDK. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Loosen ensure_not_bare rules in checkoutRussell Belfer2013-06-211-6/+27
| | | | | | | | | | | | | With the new target directory option to checkout, the non-bareness of the repository should be checked much later in the parameter validation process - actually that check was already in place, but I was doing it redundantly in the checkout APIs. This removes the now unnecessary early check for bare repos. It also adds some other parameter validation and makes it so that implied parameters can actually be passed as NULL (i.e. if you pass a git_index, you don't have to pass the git_repository - we can get it from index).
* Add target directory to checkoutRussell Belfer2013-06-213-13/+39
| | | | | | | | | | | | | | | | This adds the ability for checkout to write to a target directory instead of having to use the working directory of the repository. This makes it easier to do exports of repository data and the like. This is similar to, but not quite the same as, the --prefix option to `git checkout-index` (this will always be treated as a directory name, not just as a simple text prefix). As part of this, the workdir iterator was extended to take the path to the working directory as a parameter and fallback on the git_repository_workdir result only if it's not specified. Fixes #1332
* Fix checkout of modified file when missing from wdRussell Belfer2013-06-211-1/+3
| | | | | | | | | | This fixes the checkout case when a file is modified between the baseline and the target and yet missing in the working directory. The logic for that case appears to have been wrong. This also adds a useful checkout notify callback to the checkout test helpers that will count notifications and also has a debug mode to visualize what checkout thinks that it's doing.
* Add status flags to force output sort orderRussell Belfer2013-06-206-15/+32
| | | | | | | | | | | | | | | | Files in status will, be default, be sorted according to the case insensitivity of the filesystem that we're running on. However, in some cases, this is not desirable. Even on case insensitive file systems, 'git status' at the command line will generally use a case sensitive sort (like 'ls'). Some GUIs prefer to display a list of file case insensitively even on case-sensitive platforms. This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the default sort order of the status output and give the user control. This includes tests for exercising these new options and makes the examples/status.c program emulate core Git and always use a case sensitive sort.
* Fix bug in diff untracked dir scanRussell Belfer2013-06-201-4/+9
| | | | | | When scanning untracked directories looking for non-ignored files there was a bug where an empty directory would generate a false error.
* Add tests and fix use of freed memoryRussell Belfer2013-06-191-3/+9
| | | | | | | | | | | This adds some tests for updating the index and having it remove items to make sure that the iteration over the index still works even as earlier items are removed. In testing with valgrind, this found a path that would use the path string from the index entry after it had been freed. The bug fix is simply to copy the path of the index entry before doing any actual index manipulation.
* Add index pathspec-based operationsRussell Belfer2013-06-192-4/+217
| | | | | | | | | | | | | This adds three new public APIs for manipulating the index: 1. `git_index_add_all` is similar to `git add -A` and will add files in the working directory that match a pathspec to the index while honoring ignores, etc. 2. `git_index_remove_all` removes files from the index that match a pathspec. 3. `git_index_update_all` updates entries in the index based on the current contents of the working directory, either added the new information or removing the entry from the index.
* Add fn to check pathspec for ignored filesRussell Belfer2013-06-192-0/+67
| | | | | | | | | Command line Git sometimes generates an error message if given a pathspec that contains an exact match to an ignored file (provided --force isn't also given). This adds an internal function that makes it easy to check it that has happened. Right now, I'm not creating a public API for this because that would get a little more complicated with a need for callbacks for all invalid paths.
* Add higher level pathspec APIRussell Belfer2013-06-192-0/+39
| | | | | | | | | Right now, setting up a pathspec to be parsed and processed requires several data structures and a couple of API calls. This adds a new high level data structure that contains all the items that you'll need and high-level APIs that do all of the setup and all of the teardown. This will make it easier to use pathspecs in various places with less repeated code.
* Fix rename looped reference issuesRussell Belfer2013-06-182-108/+147
| | | | | | | This makes the diff rename tracking code more careful about the order in which it processes renames and more thorough in updating the mapping of correct renames when an earlier rename update alters the index of a later matched pair.
* Add "as_path" parameters to blob and buffer diffsRussell Belfer2013-06-174-135/+215
| | | | | | | | | | | | | | | | | | | | | | | | This adds parameters to the four functions that allow for blob-to- blob and blob-to-buffer differencing (either via callbacks or by making a git_diff_patch object). These parameters let you say that filename we should pretend the blob has while doing the diff. If you pass NULL, there should be no change from the existing behavior, which is to skip using attributes for file type checks and just look at content. With the parameters, you can plug into the new diff driver functionality and get binary or non-binary behavior, plus function context regular expressions, etc. This commit also fixes things so that the git_diff_delta that is generated by these functions will actually be populated with the data that we know about the blobs (or buffers) so you can use it appropriately. It also fixes a bug in generating patches from the git_diff_patch objects created via these functions. Lastly, there is one other behavior change that may matter. If there is no difference between the two blobs, these functions no longer generate any diff callbacks / patches unless you have passed in GIT_DIFF_INCLUDE_UNMODIFIED. This is pretty natural, but could potentially change the behavior of existing usage.
* More tests and bug fixes for status with renameRussell Belfer2013-06-175-69/+106
| | | | | | | | | | | | | | | | | | | | | This changes the behavior of the status RENAMED flags so that they will be combined with the MODIFIED flags if appropriate. If a file is modified in the index and also renamed, then the status code will have both the GIT_STATUS_INDEX_MODIFIED and INDEX_RENAMED bits set. If it is renamed but the OID has not changed, then just the GIT_STATUS_INDEX_RENAMED bit will be set. Similarly, the flags GIT_STATUS_WT_MODIFIED and GIT_STATUS_WT_RENAMED can both be set independently of one another. This fixes a serious bug where the check for unmodified files that was done at data load time could end up erasing the RENAMED state of a file that was renamed with no changes. Lastly, this contains a bunch of new tests for status with renames, including tests where the only rename changes are case changes. The expected results of these tests have to vary by whether the platform uses a case sensitive filesystem or not, so the expected data covers those platform differences separately.
* Always do tree to index diffs case sensitivelyRussell Belfer2013-06-171-0/+25
| | | | | | | | | | | | | | Trees are always case sensitive. The index is always case preserving and will be case sensitive when it is turned into a tree. Therefore the tree and the index can and should always be compared to one another case sensitively. This will restore the index to case insensitive order after the diff has been generated. Consider this a short-term fix. The long term fix is to have the index always stored both case sensitively and case insensitively (at least on platforms that sometimes require case insensitivity).
* Make index_insert keep existing caseRussell Belfer2013-06-171-2/+3
| | | | | | | | In a case insensitive index, if you attempt to add a file from disk with a different case pattern, the old case pattern in the index should be preserved. This fixes that (and a couple of minor warnings).
* Improve case handling in git_diff__paired_foreachRussell Belfer2013-06-173-112/+140
| | | | | | | | This commit reinstates some changes to git_diff__paired_foreach that were discarded during the rebase (because the diff_output.c file had gone away), and also adjusts the case insensitively logic slightly to hopefully deal with either mismatched icase diffs and other case insensitivity scenarios.
* Be more careful about the path with diffsRussell Belfer2013-06-171-1/+2
| | | | | | | | | This makes diff more careful about picking the canonical path when generating a delta so that it won't accidentally pick up a case-mismatched path on a case-insensitive file system. This should make sure we use the "most accurate" case correct version of the path (i.e. from the tree if possible, or the index if need be).
* Fix broken status EXCLUDE_SUBMODULES logicRussell Belfer2013-06-171-11/+21
| | | | | | | The exclude submodules flag was not doing the right thing, in that a file with no diff between the head and the index and just a delete in the workdir could be excluded if submodules were excluded.
* Fix some warningsRussell Belfer2013-06-171-9/+6
|
* git__strcasesort_cmp: strcasecmp sorting rules but requires strict equalityEdward Thomson2013-06-172-0/+27
|
* handle renames in status computationEdward Thomson2013-06-171-14/+92
|
* status access by index, providing more details to callersEdward Thomson2013-06-172-66/+189
|
* branch: More obvious semantics in `foreach`Vicent Marti2013-06-171-1/+5
|
* ref: free the last ref when cancelling git_branch_foreach()yorah2013-06-171-4/+2
| | | | Also fixed an assert typo on nulltoken's HEAD
* cred: deploy git__memzero to clear memory holding a passwordyorah2013-06-171-2/+2
|
* util: git__memzero() tweaksyorah2013-06-172-10/+11
| | | | | | | On Linux: fix a warning message related to the volatile qualifier (cast) On Windows: use SecureZeroMemory() On both, inline the call, so that no entry point can lead back to this "secure" memory zeroing.
* fileops: fix invalid readyorah2013-06-141-1/+1
|
* cmake: Add option to specify the name of the binarynulltoken2013-06-131-6/+4
|
* Revert "cmake: Update Windows resources to reflect the optional vendor string"Vicent Marti2013-06-121-1/+5
| | | | This reverts commit 095bfd748766966f5515bdfe64867d6a09287123.
* util: It's called `memzero`Vicent Marti2013-06-129-13/+12
|
* Merge remote-tracking branch 'arrbee/minor-paranoia' into developmentVicent Marti2013-06-1213-16/+63
|\
| * Add safe memset and use itRussell Belfer2013-06-079-13/+26
| | | | | | | | | | | | This adds a `git__memset` routine that will not be optimized away and updates the places where I memset() right before a free() call to use it.