Skip to content

Commit b120079

Browse files
committed
Merge branch 'jk/push-delete-ref-error-message' into maint
The error message from "git push $there :bogo" (and its equivalent "git push $there --delete bogo") mentioned that we tried and failed to guess what ref is being deleted based on the LHS of the refspec, which we don't. * jk/push-delete-ref-error-message: push: don't guess at qualifying remote refs on deletion
2 parents 7046e75 + 5742c82 commit b120079

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

remote.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,9 @@ static int match_explicit(struct ref *src, struct ref *dst,
11001100
case 0:
11011101
if (!memcmp(dst_value, "refs/", 5))
11021102
matched_dst = make_linked_ref(dst_value, dst_tail);
1103+
else if (is_null_sha1(matched_src->new_sha1))
1104+
error("unable to delete '%s': remote ref does not exist",
1105+
dst_value);
11031106
else if ((dst_guess = guess_ref(dst_value, matched_src)))
11041107
matched_dst = make_linked_ref(dst_guess, dst_tail);
11051108
else

0 commit comments

Comments
 (0)