summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-03-05 12:45:39 -0800
committerJunio C Hamano <gitster@pobox.com>2015-03-05 12:45:39 -0800
commitfd9de868c359a1bbd214e354aefdb0f1eaa898bd (patch)
tree1f4f619a49a6f6171e56592bb48d2db3ae927600 /builtin/commit.c
parent97c12a8b71e7d42b87b9588ba2fe0e1e44411c21 (diff)
parentd1dd721f11b7b124f35e347876e5d7204a3df664 (diff)
downloadgit-fd9de868c359a1bbd214e354aefdb0f1eaa898bd.tar.gz
Merge branch 'mh/refs-have-new'
Simplify the ref transaction API around how "the ref should be pointing at this object" is specified. * mh/refs-have-new: refs.h: remove duplication in function docstrings update_ref(): improve documentation ref_transaction_verify(): new function to check a reference's value ref_transaction_delete(): check that old_sha1 is not null_sha1 ref_transaction_create(): check that new_sha1 is valid commit: avoid race when creating orphan commits commit: add tests of commit races ref_transaction_delete(): remove "have_old" parameter ref_transaction_update(): remove "have_old" parameter struct ref_update: move "have_old" into "flags" refs.c: change some "flags" to "unsigned int" refs: remove the gap in the REF_* constant values refs: move REF_DELETING to refs.c
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 6055c760f0..961e467242 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1766,8 +1766,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (!transaction ||
ref_transaction_update(transaction, "HEAD", sha1,
current_head
- ? current_head->object.sha1 : NULL,
- 0, !!current_head, sb.buf, &err) ||
+ ? current_head->object.sha1 : null_sha1,
+ 0, sb.buf, &err) ||
ref_transaction_commit(transaction, &err)) {
rollback_index_files();
die("%s", err.buf);