]> asedeno.scripts.mit.edu Git - git.git/blobdiff - receive-pack.c
Merge branch 'jc/color'
[git.git] / receive-pack.c
index ed44b897f67a0ef051fa1bf205b2bb5747a1bd67..fba4cf82353ff43eae7430c863680f481e03dcb0 100644 (file)
@@ -200,6 +200,10 @@ static const char *update(struct command *cmd)
        }
 
        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";