t1402: test forbidden characters in refnames - #2203
Open
nikolauspschuetz wants to merge 1 commit into
Open
Conversation
git-check-ref-format(1) documents that a refname cannot contain a space, tilde, caret, colon, question-mark, asterisk or open-bracket, and that it cannot be the single character "@". Of these, only "?" was tested as a character embedded in an otherwise-valid refname; "*" was checked only as a lone character or with --refspec-pattern. Add the remaining forbidden characters in that embedded form, and check that "@" alone is rejected even with --allow-onelevel -- where "@" is otherwise a valid refname component, as "refs/@" confirms. Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
nikolauspschuetz
marked this pull request as ready for review
August 13, 2026 20:03
Author
|
/preview |
|
Preview email sent as pull.2203.git.1786651494406.gitgitgadget@gmail.com |
Author
|
/submit |
|
Submitted as pull.2203.git.1786653837190.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git-check-ref-format(1) documents the characters that a refname may not contain (space, tilde, caret, colon, question-mark, asterisk, open-bracket) and the rule that it may not be the single character "@". t1402 only exercised a few of these directly.
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).
Test-only; documents existing behaviour, in the spirit of 919eb8a (t1402: check for refs ending with a dot).