summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge submodulesEdward Thomson2014-01-2046-0/+145
|
* Support union mergesEdward Thomson2014-01-201-0/+43
|
* Remove the "merge none" flagEdward Thomson2014-01-203-201/+31
| | | | | | | The "merge none" (don't automerge) flag was only to aide in merge trivial tests. We can easily determine whether merge trivial resulted in a trivial merge or an automerge by examining the REUC after automerge has completed.
* Load merge.conflictstyle setting from configEdward Thomson2014-01-201-0/+86
|
* Introduce diff3 mode for checking out conflictsEdward Thomson2014-01-201-1/+48
|
* Don't try to merge binary filesEdward Thomson2014-01-2010-0/+40
|
* merge_file should use more aggressive levelsEdward Thomson2014-01-2028-13/+218
| | | | | | | | | | | The default merge_file level was XDL_MERGE_MINIMAL, which will produce conflicts where there should not be in the case where both sides were changed identically. Change the defaults to be more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively compress non-conflicts. This matches git.git's defaults. Increase testing around reverting a previously reverted commit to illustrate this problem.
* "Uninitialized" submodules are "unmodified"Edward Thomson2014-01-201-0/+17
| | | | | | Extend the "unmodified" submodule workdir test to include uninitialized submodules, to prevent reporting submodules as modified when they're not in the workdir at all.
* add unit tests for git_buf_join corner casesPatrick Reynolds2014-01-201-0/+31
|
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-1528-69/+70
| | | | | | 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.
* Add `git_remote_dup`.Arthur Schreiber2014-01-141-0/+21
|
* Merge pull request #2033 from xtao/blame_orig_commitBen Straub2014-01-081-0/+3
|\ | | | | Add orig_commit.
| * Add orig & final commit test.XTao2014-01-091-0/+3
| |
* | Handle git_buf's from users more liberallyEdward Thomson2014-01-085-1/+33
|/
* Merge pull request #2019 from linquize/recurse-on-demandVicent Marti2014-01-021-8/+17
|\ | | | | Accept 'submodule.*.fetchRecurseSubmodules' config 'on-demand' value
| * Update test related to fetchRecurseSubmodulesLinquize2013-12-311-8/+17
| |
* | Updated fetch.c test to pass.Marek Šuppa2013-12-311-3/+3
|/ | | I am not sure why there was 6 in the first place.
* Merge pull request #1920 from libgit2/cmn/ref-with-logVicent Marti2013-12-183-33/+146
|\ | | | | Reference operations with log
| * refs: expose has_log() on the backendCarlos Martín Nieto2013-12-091-7/+1
| | | | | | | | | | | | The frontend used to look at the file directly, but that's obviously not the right thing to do. Expose it on the backend and use that function instead.
| * refs: expose a way to ensure a ref has a logCarlos Martín Nieto2013-12-091-4/+1
| | | | | | | | | | | | Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
| * reflog: write to the reflog following git's rulesCarlos Martín Nieto2013-12-091-0/+36
| | | | | | | | | | | | git-core only writes to the reflogs of HEAD, refs/heads/ and, refs/notes/ or if there is already a reflog in place. Adjust our code to follow these semantics.
| * reflog: remove git_reflog_append_to()Carlos Martín Nieto2013-11-231-23/+0
| | | | | | | | | | | | This was a convenience method for the refs front-end to do the reflog writing. This is now done in the backend and it has no more reason for being.
| * reflog: integrate into the ref writingCarlos Martín Nieto2013-11-233-74/+6
| | | | | | | | | | | | | | | | | | | | | | | | Whenever a reference is created or updated, we need to write to the reflog regardless of whether the user gave us a message, so we shouldn't leave that to the ref frontend, but integrate it into the backend. This also eliminates the race between ref update and writing to the reflog, as we protect the reflog with the ref lock. As an additional benefit, this reflog append on the backend happens by appending to the file instead of parsing and rewriting it.
| * refs: adjust to the new reflog APICarlos Martín Nieto2013-11-232-4/+4
| |
| * refs: Introduce git_reference_symbolic_set_target_with_log()nulltoken2013-11-231-0/+39
| |
| * refs: Introduce git_reference_set_target_with_log()nulltoken2013-11-231-0/+55
| |
| * refs: Introduce git_reference_symbolic_create_with_log()nulltoken2013-11-231-0/+31
| |
| * refs: Introduce git_reference_create_with_log()nulltoken2013-11-231-0/+52
| |
* | Overwrite ignored directories on checkoutEdward Thomson2013-12-131-7/+40
| |
* | Overwrite ignored files on checkoutEdward Thomson2013-12-131-0/+74
| |
* | pool: Agh, this test doesn't really apply in 32-bit machinesVicent Marti2013-12-131-3/+0
| | | | | | | | | | | | The size_t is 32-bit already, so it overflows before going into the function. The `-1` test should handle this gracefully in both cases anyway.
* | pool: Correct overflow checksVicent Marti2013-12-131-1/+5
| | | | | | | | | | | | | | Ok, scrap the previous commit. This is the right overflow check that takes care of 64 bit overflow **and** 32-bit overflow, which needs to be considered because the pool malloc can only allocate 32-bit elements in one go.
* | Add git_treebuilder_insert test and clarify docRussell Belfer2013-12-121-15/+69
| | | | | | | | | | | | This wasn't being tested and since it has a callback, I fixed it even though the return value of this callback is not treated like any of the other callbacks in the API.
* | More tests of canceling from callbacksRussell Belfer2013-12-123-43/+186
| | | | | | | | | | This covers diff print, push, and ref foreach. This also has a fix for a small memory leak in the push tests.
* | Test cancel from indexer progress callbackRussell Belfer2013-12-113-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds tests that try canceling an indexer operation from within the progress callback. After writing the tests, I wanted to run this under valgrind and had a number of errors in that situation because mmap wasn't working. I added a CMake option to force emulation of mmap and consolidated the Amiga-specific code into that new place (so we don't actually need separate Amiga code now, just have to turn on -DNO_MMAP). Additionally, I made the indexer code propagate error codes more reliably than it used to.
* | More improvements to callback return value testsRussell Belfer2013-12-112-32/+132
| | | | | | | | | | | | This time actually checking return values in diff notify tests and actually testing callbacks for the index all-all/update-all/etc functions.
* | Try a test that won't assert on LinuxRussell Belfer2013-12-111-2/+2
| |
* | Update clone doc and tests for callback return valRussell Belfer2013-12-111-1/+56
| | | | | | | | | | | | | | Clone callbacks can return non-zero values to cancel the clone. This adds some tests to verify that this actually works and updates the documentation to be clearer that this can happen and that the return value will be propagated back by the clone function.
* | Fix checkout notify callback docs and testsRussell Belfer2013-12-111-0/+78
| | | | | | | | | | | | | | The checkout notify callback behavior on non-zero return values was not being tested. This adds tests, fixes a bug with positive values, and clarifies the documentation to make it clear that the checkout can be canceled via this mechanism.
* | Update git_blob_create_fromchunks callback behavrRussell Belfer2013-12-111-1/+38
| | | | | | | | | | | | | | The callback to supply data chunks could return a negative value to stop creation of the blob, but we were neither using GIT_EUSER nor propagating the return value. This makes things use the new behavior of returning the negative value back to the user.
* | Remove converting user error to GIT_EUSERRussell Belfer2013-12-1114-41/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Further EUSER and error propagation fixesRussell Belfer2013-12-111-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* | Improve GIT_EUSER handlingRussell Belfer2013-12-114-21/+126
| | | | | | | | | | | | | | | | | | | | | | This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
* | Merge pull request #1985 from libgit2/diff-rename-configRussell Belfer2013-12-111-0/+183
|\ \ | | | | | | Rename detection using diff.renames
| * | 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
| | |
* | | Clean up warningsEdward Thomson2013-12-094-24/+10
|/ /
* | Reorder var decls in revert testEdward Thomson2013-12-031-13/+13
| | | | | | | | Oh, MSVC.