From 6232cb6280f90cd3b53c3df71f1dddeff2e78f1c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 16:56:53 -1000 Subject: Read the expected blob through its own tag The expected content was "more" only because an earlier test had rewritten file-1, and the next test reused that file and the tag. The tag.gpgsign override did nothing, since test-lib already keeps the user's config out. --- tests/t0303-robustness.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 5ed40ba..4cb922d 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -360,10 +360,10 @@ test_expect_success 'a revision spelled like an option is refused' ' ' test_expect_success 'the blob page reads a file through an annotated tag' ' - git -C repos/rob -c tag.gpgsign=false tag -a -m note ann HEAD && - cgit_rc robrc "url=rob/blob/&h=ann&path=file-1" >tmp && + git -C repos/rob tag -a -m note ann HEAD && + git -C repos/rob cat-file blob ann:file-1 >want && + cgit_ok robrc "url=rob/blob/&h=ann&path=file-1" >tmp && strip_headers body && - printf "more\n" >want && test_cmp want body ' @@ -371,11 +371,13 @@ test_expect_success 'the blob page reads a file through an annotated tag' ' # blob page used to answer such a request with the raw commit object. test_expect_success 'the blob page walks a path out of the commit or tag the id names' ' tip=$(git -C repos/rob rev-parse HEAD) && - cgit_rc robrc "url=rob/blob/file-1&id=$tip" >tmp && + git -C repos/rob cat-file blob HEAD:file-1 >want && + cgit_ok robrc "url=rob/blob/file-1&id=$tip" >tmp && strip_headers body && test_cmp want body && tag=$(git -C repos/rob rev-parse ann) && - cgit_rc robrc "url=rob/blob/file-1&id=$tag" >tmp && + git -C repos/rob cat-file blob ann:file-1 >want && + cgit_ok robrc "url=rob/blob/file-1&id=$tag" >tmp && strip_headers body && test_cmp want body && cgit_rc robrc "url=rob/blob/missing&id=$tip" >tmp && -- cgit 2.12.1