summaryrefslogtreecommitdiff
path: root/tests/refs/reflog/reflog.c
Commit message (Collapse)AuthorAgeFilesLines
* reflog: error when a directory is at reflog pathEdward Thomson2015-11-121-0/+53
| | | | | When a non-empty directory exists and prevents the creation of a reflog, provide a more informative error message.
* reflog: test reflog is deleted when ref is deletedEdward Thomson2015-11-031-0/+18
|
* Prevent segfault when parsing a reflog with oid parse errorStjepan Rajko2015-10-291-0/+43
| | | | | | Using calloc instead of malloc because the parse error will lead to an immediate free of committer (and its properties, which can segfault on free if undefined - test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error segfaulted before the fix). #3458
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-10/+10
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* 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.
* Ensure renaming a reference updates the reflogBen Straub2014-01-301-2/+2
|
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-5/+5
| | | | | | 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.
* 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-231-3/+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.
* Rename tests-clar to testsBen Straub2013-11-141-0/+209