It makes no sense to delete a reference that is already known not to
exist.

Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to