diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-21 13:28:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-21 13:28:10 -0700 |
commit | 3c85452bb0ad744f453bb6b8e8373483a8bfc590 (patch) | |
tree | 58442bf182c21acddf0606370209f7d073beedf2 /builtin/receive-pack.c | |
parent | 13da0fc092b8cf082eda2f16971c75903aa5aefc (diff) | |
parent | 65732845e89eee69422b725bb495f4282065284f (diff) | |
download | git-3c85452bb0ad744f453bb6b8e8373483a8bfc590.tar.gz git-3c85452bb0ad744f453bb6b8e8373483a8bfc590.tar.xz |
Merge branch 'rs/ref-transaction'
The API to update refs have been restructured to allow introducing
a true transactional updates later. We would even allow storing
refs in backends other than the traditional filesystem-based one.
* rs/ref-transaction: (25 commits)
ref_transaction_commit: bail out on failure to remove a ref
lockfile: remove unable_to_lock_error
refs.c: do not permit err == NULL
remote rm/prune: print a message when writing packed-refs fails
for-each-ref: skip and warn about broken ref names
refs.c: allow listing and deleting badly named refs
test: put tests for handling of bad ref names in one place
packed-ref cache: forbid dot-components in refnames
branch -d: simplify by using RESOLVE_REF_READING
branch -d: avoid repeated symref resolution
reflog test: test interaction with detached HEAD
refs.c: change resolve_ref_unsafe reading argument to be a flags field
refs.c: make write_ref_sha1 static
fetch.c: change s_update_ref to use a ref transaction
refs.c: ref_transaction_commit: distinguish name conflicts from other errors
refs.c: pass a list of names to skip to is_refname_available
refs.c: call lock_ref_sha1_basic directly from commit
refs.c: refuse to lock badly named refs in lock_ref_sha1_basic
rename_ref: don't ask read_ref_full where the ref came from
refs.c: pass the ref log message to _create/delete/update instead of _commit
...
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r-- | builtin/receive-pack.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 6420680bd..916315ff5 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -842,8 +842,9 @@ static const char *update(struct command *cmd, struct shallow_info *si) transaction = ref_transaction_begin(&err); if (!transaction || ref_transaction_update(transaction, namespaced_name, - new_sha1, old_sha1, 0, 1, &err) || - ref_transaction_commit(transaction, "push", &err)) { + new_sha1, old_sha1, 0, 1, "push", + &err) || + ref_transaction_commit(transaction, &err)) { ref_transaction_free(transaction); rp_error("%s", err.buf); @@ -908,7 +909,7 @@ static void check_aliased_update(struct command *cmd, struct string_list *list) int flag; strbuf_addf(&buf, "%s%s", get_git_namespace(), cmd->ref_name); - dst_name = resolve_ref_unsafe(buf.buf, sha1, 0, &flag); + dst_name = resolve_ref_unsafe(buf.buf, 0, sha1, &flag); strbuf_release(&buf); if (!(flag & REF_ISSYMREF)) @@ -1069,7 +1070,7 @@ static void execute_commands(struct command *commands, check_aliased_updates(commands); free(head_name_to_free); - head_name = head_name_to_free = resolve_refdup("HEAD", sha1, 0, NULL); + head_name = head_name_to_free = resolve_refdup("HEAD", 0, sha1, NULL); checked_connectivity = 1; for (cmd = commands; cmd; cmd = cmd->next) { |