ref_transaction_delete(): remove "have_old" parameter

Instead, verify the reference's old value if and only if old_sha1 is
non-NULL.

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:
Michael Haggerty
2015-02-17 18:00:16 +01:00
committed by Junio C Hamano
parent 1d147bdff0
commit fb5a6bb61c
4 changed files with 13 additions and 12 deletions

View File

@ -265,8 +265,9 @@ static const char *parse_cmd_delete(struct ref_transaction *transaction,
if (*next != line_termination)
die("delete %s: extra input: %s", refname, next);
if (ref_transaction_delete(transaction, refname, old_sha1,
update_flags, have_old, msg, &err))
if (ref_transaction_delete(transaction, refname,
have_old ? old_sha1 : NULL,
update_flags, msg, &err))
die("%s", err.buf);
update_flags = 0;