summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-02-17 18:00:15 +0100
committerJunio C Hamano <gitster@pobox.com>2015-02-17 11:22:50 -0800
commit1d147bdff0b8132d3aa53a46df8dbab7b673b796 (patch)
treebc10a34c8136b89c3e646bb9eb1d6ea840f9376b /fast-import.c
parent8df4e51138781927962438819d79ae3221b527b5 (diff)
downloadgit-1d147bdff0b8132d3aa53a46df8dbab7b673b796.tar.gz
ref_transaction_update(): remove "have_old" parameter
Instead, verify the reference's old value if and only if old_sha1 is non-NULL. ref_transaction_delete() will get the same treatment in a moment. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fast-import.c b/fast-import.c
index d0bd285a16..1e72bfbd4c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1716,7 +1716,7 @@ static int update_branch(struct branch *b)
transaction = ref_transaction_begin(&err);
if (!transaction ||
ref_transaction_update(transaction, b->name, b->sha1, old_sha1,
- 0, 1, msg, &err) ||
+ 0, msg, &err) ||
ref_transaction_commit(transaction, &err)) {
ref_transaction_free(transaction);
error("%s", err.buf);
@@ -1756,8 +1756,8 @@ static void dump_tags(void)
strbuf_reset(&ref_name);
strbuf_addf(&ref_name, "refs/tags/%s", t->name);
- if (ref_transaction_update(transaction, ref_name.buf, t->sha1,
- NULL, 0, 0, msg, &err)) {
+ if (ref_transaction_update(transaction, ref_name.buf,
+ t->sha1, NULL, 0, msg, &err)) {
failure |= error("%s", err.buf);
goto cleanup;
}