summaryrefslogtreecommitdiff
path: root/tests/diff/workdir.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix warningsvmg/crudVicent Marti2015-10-211-1/+1
|
* diff::workdir: ensure ignored files are not returnedEdward Thomson2015-09-121-0/+43
| | | | | Ensure that a diff with the workdir is not erroneously returning directories.
* iterator: saner pathlist matching for idx iteratorEdward Thomson2015-08-311-24/+0
| | | | | | | | | | | | Some nicer refactoring for index iteration walks. The index iterator doesn't binary search through the pathlist space, since it lacks directory entries, and would have to binary search each index entry and all its parents (eg, when presented with an index entry of `foo/bar/file.c`, you would have to look in the pathlist for `foo/bar/file.c`, `foo/bar` and `foo`). Since the index entries and the pathlist are both nicely sorted, we walk the index entries in lockstep with the pathlist like we do for other iteration/diff/merge walks.
* diff: use new iterator pathlist handlingEdward Thomson2015-08-301-1/+25
| | | | | | | | When using literal pathspecs in diff with `GIT_DIFF_DISABLE_PATHSPEC_MATCH` turn on the faster iterator pathlist handling. Updates iterator pathspecs to include directory prefixes (eg, `foo/`) for compatibility with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`.
* diff: better document GIT_DIFF_PATHSPEC_DISABLEEdward Thomson2015-08-281-0/+210
| | | | | | Document that `GIT_DIFF_PATHSPEC_DISABLE` is not necessarily about explicit path matching, but also includes matching of directory names. Enforce this in a test.
* Removed unused variablesPierre-Olivier Latour2015-06-261-1/+0
|
* diff: test we don't update index unnecessarilyEdward Thomson2015-06-261-7/+69
| | | | | Test that workdir diffs, when presented with UPDATE_INDEX, only write the index when they actually make a change.
* Merge pull request #3226 from libgit2/cmn/racy-diff-againEdward Thomson2015-06-231-0/+2
|\ | | | | racy-git, the missing link
| * diff: check files with the same or newer timestampsCarlos Martín Nieto2015-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | When a file on the workdir has the same or a newer timestamp than the index, we need to perform a full check of the contents, as the update of the file may have happened just after we wrote the index. The iterator changes are such that we can reach inside the workdir iterator from the diff, though it may be better to have an accessor instead of moving these structs into the header.
* | Explicitly handle GIT_DELTA_CONFLICTED in git_diff_merge()Pierre-Olivier Latour2015-06-221-0/+36
|/ | | | | This fixes a bug where if a file was in conflicted state in either diff, it would not always remain in conflicted state in the merged diff.
* tests: tick the index when we count OID calculationsCarlos Martín Nieto2015-06-161-0/+6
| | | | | | | | | These tests want to test that we don't recalculate entries which match the index already. This is however something we force when truncating racily-clean entries. Tick the index forward as we know that we don't perform the modifications which the racily-clean code is trying to avoid.
* diff: introduce binary diff callbacksEdward Thomson2015-06-121-56/+56
| | | | | | | Introduce a new binary diff callback to provide the actual binary delta contents to callers. Create this data from the diff contents (instead of directly from the ODB) to support binary diffs including the workdir, not just things coming out of the ODB.
* Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-021-1/+1
|
* diff conflicts: test index to workdir w/ conflictsEdward Thomson2015-05-281-0/+45
|
* Fix compile error on Visual StudioCha, Hojeong2014-05-271-2/+2
|
* Git binary check compat testsrb/update-4k-to-8kRussell Belfer2014-05-161-0/+114
| | | | | A variety of data patterns for diffs verified to match the behavior of binary detection with Git on the command line.
* Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-021-40/+20
|
* Add payloads, bitmaps to trace APIRussell Belfer2014-05-021-25/+4
| | | | | | | | | This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
* Don't use trace if GIT_TRACE not definedRussell Belfer2014-05-021-0/+8
|
* Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-05-021-21/+45
| | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
* Add diff option to update index stat cacheRussell Belfer2014-05-021-0/+87
| | | | | | | | | | When diff is scanning the working directory, if it finds a file where it is not sure if the index entry matches the working dir, it will recalculate the OID (which is pretty expensive). This adds a new flag to diff so that if the OID calculation finds that the file actually has not changed (i.e. just the modified time was altered or such), then it will refresh the stat cache in the index so that future calls to diff will not have to check the oid again.
* Skip diff oid calc when size definitely changedRussell Belfer2014-05-021-2/+2
| | | | | | | | | | | | | When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
* Add build option for diff internal statisticsRussell Belfer2014-05-021-0/+12
|
* Update behavior for untracked sub-reposRussell Belfer2014-03-251-3/+3
| | | | | | | | | | | When a directory containing a .git directory (or even just a plain gitlink) was found, libgit2 was going out of its way to treat it specially. This seemed like it was necessary because the diff code was not originally emulating Git's behavior for untracked directories correctly (i.e. scanning for ignored vs untracked items inside). Now that libgit2 diff mimics Git's untracked directory behavior, the special handling for contained Git repos is actually incorrect and this commit rips it out.
* Drop git_patch_to_strNicolas Hake2014-01-221-7/+9
| | | | | | | It's hard or even impossible to correctly free the string buffer allocated by git_patch_to_str in some circumstances. Drop the function so people have to use git_patch_to_buf instead - git_buf has a dedicated destructor.
* Rename tests-clar to testsBen Straub2013-11-141-0/+1490