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>
This commit is contained in:
committed by
Junio C Hamano
parent
8df4e51138
commit
1d147bdff0
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user