diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-02-17 18:00:16 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-17 11:23:48 -0800 |
commit | fb5a6bb61c215546b94156bbb54d43225424f7d0 (patch) | |
tree | e157715e73f2e574d82205e7a8a06b40a205f377 /builtin/update-ref.c | |
parent | 1d147bdff0b8132d3aa53a46df8dbab7b673b796 (diff) | |
download | git-fb5a6bb61c215546b94156bbb54d43225424f7d0.tar.gz git-fb5a6bb61c215546b94156bbb54d43225424f7d0.tar.xz |
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>
Diffstat (limited to 'builtin/update-ref.c')
-rw-r--r-- | builtin/update-ref.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 1ad6ce187..226995f02 100644 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -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; |