diff --git a/receive-pack.c b/receive-pack.c
index ed44b897f67a0ef051fa1bf205b2bb5747a1bd67..fba4cf82353ff43eae7430c863680f481e03dcb0 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
}
if (is_null_sha1(new_sha1)) {
+ if (!parse_object(old_sha1)) {
+ warning ("Allowing deletion of corrupt ref.");
+ old_sha1 = NULL;
+ }
if (delete_ref(name, old_sha1)) {
error("failed to delete %s", name);
return "failed to delete";