]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.c
push: don't guess at qualifying remote refs on deletion
[thirdparty/git.git] / remote.c
index b296d174043b5e5a11aceb9940ba6ba035e77678..6b07e580aeebe6d5f8915fa5d8f1237413326f15 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1078,6 +1078,9 @@ static int match_explicit(struct ref *src, struct ref *dst,
        case 0:
                if (!memcmp(dst_value, "refs/", 5))
                        matched_dst = make_linked_ref(dst_value, dst_tail);
+               else if (is_null_sha1(matched_src->new_sha1))
+                       error("unable to delete '%s': remote ref does not exist",
+                             dst_value);
                else if ((dst_guess = guess_ref(dst_value, matched_src)))
                        matched_dst = make_linked_ref(dst_guess, dst_tail);
                else