зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
f04c5b5522
Коммит
60294596ba
2
refs.c
2
refs.c
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче