Thread (7 messages) flat view 7 messages, 4 authors, 2026-08-23

Re: [PATCH v2] t1402: test forbidden characters in refnames

From: Junio C Hamano <hidden>
Date: 2026-08-21 09:29:22

"Nikolaus Schuetz via GitGitGadget" [off-list ref] writes:
    This adds the remaining forbidden characters in embedded form, and
    checks that "@" alone is rejected even with --allow-onelevel, where "@"
    is otherwise a valid refname component (as "refs/@" confirms).
Many funny characters are not allowed between 'foo' and 'bar', but
are there characters other than dot that are not allowed at the
beginning or at the end (e.g., "refs/heads/foo." and "foo.lock")?

IOW are we testing exhaustive now?
 invalid_ref '.refs/foo'
 invalid_ref 'refs/heads/foo.'
-invalid_ref 'heads/foo..bar'
-invalid_ref 'heads/foo?bar'
+for c in '?' '~' '^' ':' '*' '[' ' ' '\' '..'
+do
+	invalid_ref "heads/foo${c}bar"
+done
 valid_ref 'foo./bar'
 invalid_ref 'heads/foo.lock'
 invalid_ref 'heads///foo.lock'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help