summaryrefslogtreecommitdiff
path: root/tests/refs
Commit message (Collapse)AuthorAgeFilesLines
* Introduce cl_assert_equal_oidEdward Thomson2014-07-0110-26/+24
|
* refs: failing test for concurrent ref accessCarlos Martín Nieto2014-06-021-0/+33
| | | | | If we remove a reference while we're iterating through the packed refs, the position in the iterator will be off.
* Refs: Extend unicode test for branch creation.Arthur Schreiber2014-05-301-0/+3
| | | | | | This adds another assertion to ensure that the reference name inside the git_reference struct returned by `git_branch_create` is returned as precomposed if `core.precomposeunicode` is enabled.
* Refs: Add a unicode test for git_branch_move.Arthur Schreiber2014-05-301-0/+17
| | | | | This tests that decomposed branch names are correctly precomposed when passed to `git_branch_move` and `core.precomposeunicode` is enabled.
* Don't always test composed-insensitive lookupsrb/unicode-branch-namesRussell Belfer2014-05-081-4/+4
| | | | | | Only on a filesystem that is composed/decomposed insensitive, should be testing that a branch can be looked up by the opposite form and still work correctly.
* Pass unconverted data when iconv doesn't like itRussell Belfer2014-05-081-0/+56
| | | | | | | | | | | | | | When using Iconv to convert unicode data and iconv doesn't like the source data (because it thinks that it's not actual UTF-8), instead of stopping the operation, just use the unconverted data. This will generally do the right thing on the filesystem, since that is the source of the non-UTF-8 path data anyhow. This adds some tests for creating and looking up branches with messy Unicode names. Also, this takes the helper function that was previously internal to `git_repository_init` and makes it into `git_path_does_fs_decompose_unicode` which is a useful in tests to understand what the expected results should be.
* Some further sandboxing cleanups to testsRussell Belfer2014-05-023-32/+8
| | | | | Trying to find other issues where tests may not clean up quite properly when they are through...
* Add GIT_BRANCH_ALL to git_branch_t enumSven Strickroth2014-04-161-2/+2
| | | | | | | | git_branch_t is an enum so requesting GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE is not possible as it is not a member of the enum (at least VS2013 C++ complains about it). This fixes a regression introduced in commit a667ca8298193b3103c1dbdcb1f6c527e6e99eb2 (PR #1946). Signed-off-by: Sven Strickroth <email@cs-ware.de>
* reflog: follow core.logallrefupdatesCarlos Martín Nieto2014-03-201-0/+73
| | | | | On bare by default, or when core.logallrefupdates is false, we must not write the reflog.
* refdb: don't update when there's no needCarlos Martín Nieto2014-03-191-0/+24
| | | | | If the caller wants to update a ref to point to the same target as it currently has, we should return early and avoid writing to the reflog.
* refs: append to the HEAD reflog when updating the current branchCarlos Martín Nieto2014-03-171-0/+23
| | | | | | | | When we update the current branch, we must also append to HEAD's reflog to keep them in sync. This is a bit of a hack, but as git.git says, it covers 100% of default cases.
* Merge pull request #2144 from linquize/branch-f-currentBen Straub2014-03-021-0/+19
|\ | | | | Do not allow git_branch_create() to force update branch
| * Add unit test to show git_branch_create() fails if attempt to force create ↵Linquize2014-03-021-0/+19
| | | | | | | | current branch
* | refs: move current_id before the reflog parametersCarlos Martín Nieto2014-02-101-4/+4
| | | | | | | | | | Keep the reflog parameters as the last two, as they're the optional parameters.
* | Merge pull request #2099 from libgit2/bs/more-reflog-stuffRussell Belfer2014-02-072-5/+6
|\ \ | | | | | | More reflogness
| * | Add reflog params to git_repository_detach_headBen Straub2014-02-041-1/+1
| | |
| * | Reset helpers: use revparse insteadBen Straub2014-02-031-4/+5
| | |
* | | refs: add an unconditional deleteCarlos Martín Nieto2014-02-051-0/+14
| | | | | | | | | | | | | | | Add it under the git_reference_remove() name, letting the user pass the repo and name, analogous to unconditional setting/creation.
* | | refs: catch cases where the ref type has changedCarlos Martín Nieto2014-02-051-0/+58
| | | | | | | | | | | | | | | If the type of the on-disk reference has changed, the old value comparison should fail.
* | | refs: check the ref's old value when deletingCarlos Martín Nieto2014-02-051-0/+33
| | | | | | | | | | | | Recognize when the reference has changed since we loaded it.
* | | refs: bring conditional symbolic updates to the frontendCarlos Martín Nieto2014-02-051-1/+20
| | | | | | | | | | | | Bring the race detection goodness to symbolic references as well.
* | | refs: add tests for conditional updatesCarlos Martín Nieto2014-02-051-0/+42
|/ /
* | Add `git_reference_is_note`.Arthur Schreiber2014-02-021-0/+15
|/
* Allow tests to run without user configBen Straub2014-01-302-0/+12
|
* Enhance testing of signature parametersBen Straub2014-01-303-4/+28
|
* Provide good default reflog messages in branch apiBen Straub2014-01-302-0/+38
|
* Ensure moving a branch updates the reflogBen Straub2014-01-301-0/+19
|
* Ensure renaming a reference updates the reflogBen Straub2014-01-303-14/+32
|
* Add reflog parameters to git_branch_moveBen Straub2014-01-301-13/+13
|
* Deleting a branch deletes its reflogBen Straub2014-01-302-20/+26
|
* 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