From: Junio C Hamano Date: Fri, 21 Aug 2026 09:29:18 GMT Subject: Re: [PATCH v2] t1402: test forbidden characters in refnames Message-ID: In-Reply-To: "Nikolaus Schuetz via GitGitGadget" 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'