From: Michael Haggerty Date: Sun, 08 Feb 2015 16:14:03 GMT Subject: [PATCH 09/11] ref_transaction_delete(): check that old_sha1 is not null_sha1 Message-ID: <1423412045-15616-10-git-send-email-mhagger@alum.mit.edu> In-Reply-To: <1423412045-15616-1-git-send-email-mhagger@alum.mit.edu> It makes no sense to delete a reference that is already known not to exist. Signed-off-by: Michael Haggerty --- refs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/refs.c b/refs.c index 8ab1f8e..85815d7 100644 --- a/refs.c +++ b/refs.c @@ -3703,6 +3703,8 @@ int ref_transaction_delete(struct ref_transaction *transaction, int flags, const char *msg, struct strbuf *err) { + if (old_sha1 && is_null_sha1(old_sha1)) + die("BUG: delete called with old_sha1 set to zeros"); return ref_transaction_update(transaction, refname, null_sha1, old_sha1, flags, msg, err); -- 2.1.4