[PATCH v5 4/5] name-rev: make dedicated --annotate-stdin --name-only test
- From
- kristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
- Date
- May 11, 2026, 15:45 UTC
- Message-ID
- <V5_name-rev_dedicated_test.6cd@msgid.xyz>
- In-Reply-To
- <V5_CV_format-rev.6c9@msgid.xyz>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
The previous commit split the `--name-only` handling:
1. `--annotate-stdin`: uses the new `struct command` 2. The rest: uses `struct name_ref_data`
But there is no dedicated test for the option combination in (1). That means that the following tests will fail if you neglect to set `command.u.name_only` properly:
name-rev --annotate-stdin works with commitGraph
name-rev --annotate-stdin works with non-monotonic timestampseven though it has nothing to do with what these tests are supposed to test.
Let’s add another regression test now that it is relevant.
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> --- t/t6120-describe.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index 2c70cc561ad..62789f76381 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -298,6 +298,20 @@ test_expect_success 'name-rev --annotate-stdin' ' test_cmp expect actual ' +test_expect_success 'name-rev --annotate-stdin --name-only' ' + >expect.unsorted && + for rev in $(git rev-list --all) + do + name=$(git name-rev --name-only $rev) && + echo "$name" >>expect.unsorted || return 1 + done && + sort <expect.unsorted >expect && + git name-rev --annotate-stdin --name-only \ + <list >actual.unsorted && + sort <actual.unsorted >actual && + test_cmp expect actual +' + test_expect_success 'name-rev --stdin deprecated' ' git rev-list --all >list && if ! test_have_prereq WITH_BREAKING_CHANGES
-- 2.54.0.13.g9c7419e39f8