summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-02-17 17:00:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-17 19:22:50 (GMT)
commit1d147bdff0b8132d3aa53a46df8dbab7b673b796 (patch)
treebc10a34c8136b89c3e646bb9eb1d6ea840f9376b /builtin/fetch.c
parent8df4e51138781927962438819d79ae3221b527b5 (diff)
downloadgit-1d147bdff0b8132d3aa53a46df8dbab7b673b796.zip
git-1d147bdff0b8132d3aa53a46df8dbab7b673b796.tar.gz
git-1d147bdff0b8132d3aa53a46df8dbab7b673b796.tar.bz2
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 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 7b84d35..719bf4f 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -416,8 +416,10 @@ static int s_update_ref(const char *action,
transaction = ref_transaction_begin(&err);
if (!transaction ||
- ref_transaction_update(transaction, ref->name, ref->new_sha1,
- ref->old_sha1, 0, check_old, msg, &err))
+ ref_transaction_update(transaction, ref->name,
+ ref->new_sha1,
+ check_old ? ref->old_sha1 : NULL,
+ 0, msg, &err))
goto fail;
ret = ref_transaction_commit(transaction, &err);