summaryrefslogtreecommitdiff
path: root/tests/diff
Commit message (Collapse)AuthorAgeFilesLines
* tests: take the version from our defineCarlos Martín Nieto2016-03-031-1/+1
|
* tests: use legitimate object idsEdward Thomson2016-02-282-7/+9
| | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
* Merge pull request #3613 from ethomson/fixupsCarlos Martín Nieto2016-02-181-2/+2
|\ | | | | Remove most of the silly warnings
| * win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-121-2/+2
| | | | | | | | | | Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
* | Horrible fix for #3173.Arthur Schreiber2016-02-111-2/+2
|/
* diff: include commit message when formatting patchPatrick Steinhardt2015-12-011-0/+41
| | | | | | When formatting a patch as email we do not include the commit's message in the formatted patch output. Implement this and add a test that verifies behavior.
* Fix some warningsJacques Germishuys2015-11-201-0/+1
|
* Merge pull request #3498 from ethomson/windows_symlinksCarlos Martín Nieto2015-11-081-0/+61
|\ | | | | Diff: Honor `core.symlinks=false` and fake symlinks
| * diff: test "symlinks" in wd are respected on win32Edward Thomson2015-11-031-0/+61
| | | | | | | | | | | | | | | | When `core.symlinks = false`, we write the symlinks content (target) to a regular file. We should ensure that when we later see that regular file, we treat it specially - and that changing that regular file would actually change the symlink target. (For compatibility with Git for Windows).
* | Add diff progress callback.Jason Haslam2015-11-022-2/+29
|/
* tests: Fix warningsvmg/crudVicent Marti2015-10-211-1/+1
|
* Fix binary diffsGuille -bisho-2015-09-251-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git expects an empty line after the binary data: literal X ...binary data... <empty_line> The last literal block of the generated patches were not containing the required empty line. Example: diff --git a/binary_file b/binary_file index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 6 Nc${NM%g@i}0ssZ|0lokL diff --git a/binary_file2 b/binary_file2 index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 13 Sc${NMEKbZyOexL+Qd|HZV+4u- git apply of that diff results in: error: corrupt binary patch at line 9: diff --git a/binary_file2 b/binary_file2 fatal: patch with only garbage at line 10 The proper formating is: diff --git a/binary_file b/binary_file index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 6 Nc${NM%g@i}0ssZ|0lokL diff --git a/binary_file2 b/binary_file2 index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 13 Sc${NMEKbZyOexL+Qd|HZV+4u-
* 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.
* iterator: use an options struct instead of argsEdward Thomson2015-08-281-14/+46
|
* diff: don't error out on an invalid regexcmn/regex-nofailCarlos Martín Nieto2015-08-151-0/+26
| | | | | | When parsing user-provided regex patterns for functions, we must not fail to provide a diff just because a pattern is not well formed. Ignore it instead.
* Added git_diff_index_to_index()Pierre-Olivier Latour2015-06-301-0/+32
|
* Merge pull request #3265 from libgit2/leaksCarlos Martín Nieto2015-06-271-1/+5
|\ | | | | Plug a bunch of leaks
| * diff: fix leaks in diff printingCarlos Martín Nieto2015-06-261-1/+5
| |
* | Merge pull request #3263 from git-up/fixesCarlos Martín Nieto2015-06-262-2/+0
|\ \ | |/ |/| Fixes
| * Removed unused variablesPierre-Olivier Latour2015-06-262-2/+0
| |
* | test-diff-blob: Pass proper nibble sizesvmg/prefix-lenVicent Marti2015-06-261-14/+14
|/
* 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.
* Rename FALLBACK to UNSPECIFIEDcmn/rename-unspecifiedCarlos Martín Nieto2015-06-251-1/+1
| | | | | Fallback describes the mechanism, while unspecified explains what the user is thinking.
* Merge pull request #3097 from libgit2/cmn/submodule-config-stateCarlos Martín Nieto2015-06-242-9/+9
|\ | | | | Remove run-time configuration settings from submodules
| * submodule: add an ignore option to statusCarlos Martín Nieto2015-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This lets us specify in the status call which ignore rules we want to use (optionally falling back to whatever the submodule has in its configuration). This removes one of the reasons for having `_set_ignore()` set the value in-memory. We re-use the `IGNORE_RESET` value for this as it is no longer relevant but has a similar purpose to `IGNORE_FALLBACK`. Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of initializers and move that to fall back to the configuration as well.
| * submodule: make set_ignore() affect the configurationCarlos Martín Nieto2015-06-221-8/+8
| | | | | | | | | | Instead of affecting a particular instance, make it change the configuration.
* | diff::binary tests: empty diff when forced binaryEdward Thomson2015-06-241-0/+30
| | | | | | | | | | | | Ensure that even when we're forcing a binary diff that we do not assume that there *is* a diff. There should be an empty diff for no change.
* | binary diff: test that the diff and patch otputs are the samecmn/diff-binary-patchCarlos Martín Nieto2015-06-241-0/+7
| | | | | | | | | | | | | | | | We test the generation of the textual patch via the patch function, which are just one of two possibilities to get the output. Add a second patch generation via the diff function to make sure both outputs are in sync.
* | Merge pull request #3222 from git-up/conflictedEdward Thomson2015-06-231-1/+30
|\ \ | | | | | | Fixed GIT_DELTA_CONFLICTED not returned in some cases
| * | Fixed GIT_DELTA_CONFLICTED not returned in some casesPierre-Olivier Latour2015-06-231-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | If an index entry for a file that is not in HEAD is in conflicted state, when diffing HEAD with the index, the status field of the corresponding git_diff_delta was incorrectly reported as GIT_DELTA_ADDED instead of GIT_DELTA_CONFLICTED. This was due to handle_unmatched_new_item() initially setting the status to GIT_DELTA_CONFLICTED but then overriding it later with GIT_DELTA_ADDED.
* | | Merge pull request #3226 from libgit2/cmn/racy-diff-againEdward Thomson2015-06-232-39/+2
|\ \ \ | |/ / |/| | racy-git, the missing link
| * | tests: move racy tests to the indexCarlos Martín Nieto2015-06-221-100/+0
| | | | | | | | | | | | | | | They fit there much better, even though we often check by diffing, it's about the behaviour of the index.
| * | tests: set racy times manuallyCarlos Martín Nieto2015-06-221-6/+26
| | |
| * | tests: plug leaks in the racy testCarlos Martín Nieto2015-06-221-1/+9
| | |
| * | diff: check files with the same or newer timestampsCarlos Martín Nieto2015-06-222-0/+35
| |/ | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #3219 from libgit2/cmn/racy-diffCarlos Martín Nieto2015-06-172-0/+45
|\ | | | | Zero out racily-clean entries' file_size
| * 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: add failing test for racy-git in the indexCarlos Martín Nieto2015-06-161-0/+39
| | | | | | | | | | | | | | | | | | | | | | We update the index and then immediately change the contents of the file. This makes the diff think there are no changes, as the timestamp of the file agrees with the cached data. This is however a bug, as the file has obviously changed contents. The test is a bit fragile, as it assumes that the index writing and the following modification of the file happen in the same second, but it's enough to show the issue.
* | Fixed Xcode 6.1 build warningsPierre-Olivier Latour2015-06-152-9/+17
|/
* binary diff: test binary blob to blob testsEdward Thomson2015-06-121-0/+130
|
* diff: introduce binary diff callbacksEdward Thomson2015-06-129-163/+182
| | | | | | | 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.
* binary diff: test index->workdir binary diffsEdward Thomson2015-06-121-0/+99
|
* Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-022-2/+2
|
* diff conflicts: test index to workdir w/ conflictsEdward Thomson2015-05-281-0/+45
|
* diff conflicts: add tests for tree to indexEdward Thomson2015-05-283-2/+78
|
* git_path_dirload: use git_path_diriterEdward Thomson2015-05-011-1/+1
|