name-rev: make dedicated --annotate-stdin --name-only test

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 timestamps even 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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kristoffer Haugsbakk committed May 11, 2026 at 17:45 UTC ae34adcf035b0b9bed705727e8884082ff4ae7aa
1 file changed +14
t/t6120-describe.sh
+14
@@ -298,6 +298,20 @@ test_expect_success 'name-rev --annotate-stdin' '
298 test_cmp expect actual
299 '
300
301 +test_expect_success 'name-rev --annotate-stdin --name-only' '
302 + >expect.unsorted &&
303 + for rev in $(git rev-list --all)
304 + do
305 + name=$(git name-rev --name-only $rev) &&
306 + echo "$name" >>expect.unsorted || return 1
307 + done &&
308 + sort <expect.unsorted >expect &&
309 + git name-rev --annotate-stdin --name-only \
310 + <list >actual.unsorted &&
311 + sort <actual.unsorted >actual &&
312 + test_cmp expect actual
313 +'
314 +
315 test_expect_success 'name-rev --stdin deprecated' '
316 git rev-list --all >list &&
317 if ! test_have_prereq WITH_BREAKING_CHANGES