"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'