aboutsummaryrefslogtreecommitdiffstats
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:10 -0700
committerJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:10 -0700
commit4a25b911cdb0cd79b6ab8b60ccbece77df03340d (patch)
tree16789d37c5339c7cfd14551334833c8eb5b21474 /connect.c
parentMerge branch 'ak/restore-both-incompatible-with-conflicts' (diff)
parentpush: allow delete single-level ref (diff)
downloadgit-4a25b911cdb0cd79b6ab8b60ccbece77df03340d.tar.gz
git-4a25b911cdb0cd79b6ab8b60ccbece77df03340d.zip
Merge branch 'zh/push-to-delete-onelevel-ref'
"git push" has been taught to allow deletion of refs with one-level names to help repairing a repository who acquired such a ref by mistake. In general, we don't encourage use of such a ref, and creation or update to such a ref is rejected as before. * zh/push-to-delete-onelevel-ref: push: allow delete single-level ref receive-pack: fix funny ref error messsage
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/connect.c b/connect.c
index 134069574a..000865bc33 100644
--- a/connect.c
+++ b/connect.c
@@ -31,7 +31,8 @@ static int check_ref(const char *name, unsigned int flags)
return 0;
/* REF_NORMAL means that we don't want the magic fake tag refs */
- if ((flags & REF_NORMAL) && check_refname_format(name, 0))
+ if ((flags & REF_NORMAL) && check_refname_format(name,
+ REFNAME_ALLOW_ONELEVEL))
return 0;
/* REF_HEADS means that we want regular branch heads */