summaryrefslogtreecommitdiff
path: root/tests/refs
Commit message (Collapse)AuthorAgeFilesLines
...
* Add reflog params to git_branch_createBen Straub2014-01-303-13/+17
|
* Add passing reflog testsBen Straub2014-01-301-1/+29
|
* branch: move to git_buf when outputting newly-allocated stringsCarlos Martín Nieto2014-01-272-34/+15
| | | | | Internally we already did everything with git_bufs, so this is just exposing those functions with public names.
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-1517-52/+53
| | | | | | 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.
* 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
| |
* | More tests of canceling from callbacksRussell Belfer2013-12-121-18/+109
| | | | | | | | | | This covers diff print, push, and ref foreach. This also has a fix for a small memory leak in the push tests.
* | Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Improve GIT_EUSER handlingRussell Belfer2013-12-111-1/+43
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Clean up warningsEdward Thomson2013-12-091-1/+2
|/
* Rename tests-clar to testsBen Straub2013-11-1434-0/+4420