From fb5a6bb61c215546b94156bbb54d43225424f7d0 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Tue, 17 Feb 2015 18:00:16 +0100 Subject: 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 Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- builtin/receive-pack.c | 3 +-- builtin/update-ref.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'builtin') diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 0be50e9540..70e9ce5f96 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -953,8 +953,7 @@ static const char *update(struct command *cmd, struct shallow_info *si) if (ref_transaction_delete(transaction, namespaced_name, old_sha1, - 0, old_sha1 != NULL, - "push", &err)) { + 0, "push", &err)) { rp_error("%s", err.buf); strbuf_release(&err); return "failed to delete"; diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 1ad6ce1877..226995f029 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; -- cgit v1.2.3