diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-02-17 18:00:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-17 11:24:55 -0800 |
commit | 60294596ba6bf2f63506ffad60b9a94fc04612a1 (patch) | |
tree | 1a64454810ce15c926ecae61114cfec5489c605b | |
parent | f04c5b5522214cd48b39399d1d26b07848fd0e52 (diff) | |
download | git-60294596ba6bf2f63506ffad60b9a94fc04612a1.tar.gz |
ref_transaction_delete(): check that old_sha1 is not null_sha1
It makes no sense to delete a reference that is already known not to
exist.
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>
-rw-r--r-- | refs.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3702,6 +3702,8 @@ int ref_transaction_delete(struct ref_transaction *transaction, unsigned 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); |