t1401: test symbolic-ref exit codes on a non-symbolic ref - #2204
Open
nikolauspschuetz wants to merge 1 commit into
Open
t1401: test symbolic-ref exit codes on a non-symbolic ref#2204nikolauspschuetz wants to merge 1 commit into
nikolauspschuetz wants to merge 1 commit into
Conversation
nikolauspschuetz
marked this pull request as ready for review
August 13, 2026 21:11
Author
|
/submit |
|
Submitted as pull.2204.git.1786655554197.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
git-symbolic-ref(1) documents that reading a name that is not a symbolic ref exits non-zero, and that --quiet does so silently. Tests such as t2020 and t5621 already rely on "symbolic-ref -q HEAD" failing on a detached HEAD, but none pins the exact exit codes or checks that --quiet actually suppresses the diagnostic. Assert that a non-symbolic ref exits 128 with the "is not a symbolic ref" message, and that --quiet instead exits 1 with no output. Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
nikolauspschuetz
force-pushed
the
ns/t1401-symbolic-ref-quiet
branch
from
August 13, 2026 21:37
345e664 to
fa9dd1d
Compare
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-symbolic-ref(1) documents that reading a name that is not a symbolic ref exits with a non-zero status, and that --quiet does so silently rather than printing a diagnostic. This exit-code contract was untested.
This adds two tests: querying a non-symbolic ref exits 128 with the usual "is not a symbolic ref" message, and --quiet instead exits 1 with no output.
Test-only; documents existing behaviour, in the spirit of 919eb8a (t1402: check for refs ending with a dot).