summaryrefslogtreecommitdiff
path: root/tests/diff
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove most submodule reloads from testsRussell Belfer2014-04-011-5/+0
| | | | | | | | | | | With the new submodule cache validity checks, we generally don't need to call git_submodule_reload_all to have up-to-date submodule data. Some tests are still calling it where I want to actually test that it can be called safely and doesn't break anything, but mostly it is not needed. This also expands some of the existing submodule tests to cover some variants on the behavior that was already being tested.
* Improve test of submodule name sortingRussell Belfer2014-03-311-0/+6
|
* Fix memory leak of test repository objectRussell Belfer2014-03-271-2/+5
|
* Merge pull request #2204 from libgit2/rb/submodule-reference-countingVicent Marti2014-03-261-3/+7
|\ | | | | Make submodules externally refcounted
| * Make submodules externally refcountedRussell Belfer2014-03-251-3/+7
| | | | | | | | | | | | | | | | `git_submodule` objects were already refcounted internally in case the submodule name was different from the path at which it was stored. This makes that refcounting externally used as well, so `git_submodule_lookup` and `git_submodule_add_setup` return an object that requires a `git_submodule_free` when done.
* | Update behavior for untracked sub-reposRussell Belfer2014-03-253-6/+68
|/ | | | | | | | | | | 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.
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-3/+3
|
* Add buffer to buffer diff and patch APIsRussell Belfer2014-02-271-150/+90
| | | | | | | | This adds `git_diff_buffers` and `git_patch_from_buffers`. This also includes a bunch of internal refactoring to increase the shared code between these functions and the blob-to-blob and blob-to-buffer APIs, as well as some higher level assert helpers in the tests to also remove redundancy.
* Merge pull request #2066 from libgit2/rb/builtin-diff-driversVicent Marti2014-01-272-29/+119
|\ | | | | Add built in diff drivers
| * Update Javascript userdiff driver and testsRussell Belfer2014-01-271-12/+16
| | | | | | | | | | | | | | | | | | Writing a sample Javascript driver pointed out some extra whitespace handling that needed to be done in the diff driver. This adds some tests with some sample javascript code that I pulled off of GitHub just to see what would happen. Also, to clean up the userdiff test data, I did a "git gc" and packed up the test objects.
| * Move userdiff tests to be data drivenRussell Belfer2014-01-241-47/+50
| | | | | | | | | | | | This moves the expected and actual test data along with the source data for the userdiff tests into the tests/resources/userdiff test repo and updates the test to use that.
| * Update all tests for new pattern extractionRussell Belfer2014-01-241-4/+4
| |
| * Implement matched pattern extract for fn headersRussell Belfer2014-01-241-2/+2
| |
| * Fix filemode updating in diff textRussell Belfer2014-01-241-7/+15
| |
| * Import git drivers and test HTML driverRussell Belfer2014-01-241-24/+99
| | | | | | | | | | | | | | | | | | | | Reorganize the builtin driver table slightly so that core Git builtin definitions can be imported verbatim. Then take a few of the core Git drivers and pull them in. This also creates a test of diffs with the builtin HTML driver which led to some small error handling fixes in the driver selection logic.
* | diff: rename the file's 'oid' to 'id'Carlos Martín Nieto2014-01-251-16/+16
| | | | | | | | In the same vein as the previous commits in this series.
* | index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-251-1/+1
|/ | | | This was not converted when we converted the rest, so do it now.
* Drop git_patch_to_strNicolas Hake2014-01-227-89/+94
| | | | | | | 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.
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-3/+3
| | | | | | Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
* More tests of canceling from callbacksRussell Belfer2013-12-121-3/+36
| | | | | This covers diff print, push, and ref foreach. This also has a fix for a small memory leak in the push tests.
* More improvements to callback return value testsRussell Belfer2013-12-111-2/+4
| | | | | | This time actually checking return values in diff notify tests and actually testing callbacks for the index all-all/update-all/etc functions.
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-113-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Don't clobber whitespace settingsBen Straub2013-12-061-0/+42
|
* Don't use weird return codesBen Straub2013-12-051-0/+3
|
* Implement GIT_DIFF_FIND_BY_CONFIGBen Straub2013-12-051-0/+138
|
* GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds betterRussell Belfer2013-12-021-1/+1
|
* Add GIT_DIFF_FIND_DELETE_UNMODIFIED flagRussell Belfer2013-12-021-0/+48
| | | | | | | | | | When doing copy detection, it is often necessary to include UNMODIFIED records in the git_diff so they are available as source records for GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED. Yet in the final diff, often you will not want to have these UNMODIFIED records. This adds a flag which marks these UNMODIFIED records for deletion from the diff list so they will be removed after the rename detect phase is over.
* Fix bug making split deltas a COPIED targetsRussell Belfer2013-12-021-0/+49
| | | | | | | | When FIND_COPIES is used in combination with BREAK_REWRITES for rename detection, there was a bug where the split MODIFIED delta was only used as a target for RENAME records and not for COPIED records. This fixes that, converting the split into a pair of DELETED and COPIED deltas when that circumstance arises.
* Add content offset to git_diff_lineNick Hengeveld2013-11-181-0/+6
| | | | | | For additions and deletions, external consumers like subversion can make use of the content offset to generate diffs in their proprietary formats.
* Rename tests-clar to testsBen Straub2013-11-1414-0/+7714