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

Junio C Hamano <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
"Nikolaus Schuetz via GitGitGadget" <[email protected]> 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'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.