From 09a5334f28c853530ab6a70e11929e9a0f2aca45 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 1 Oct 2026 17:27:43 -1000 Subject: Walk a path on the blob page from any commit the id names With both an id and a path the blob page handed back the raw object the id named, so a commit id gave the commit text itself, while the plain page looked the path up in that commit's tree. A tag is peeled to its commit on the way, and the README example of a pinned commit now uses a form the request checks accept. --- tests/t0303-robustness.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 73c2ca5..5bdb060 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -246,6 +246,21 @@ test_expect_success 'the blob page reads a file through an annotated tag' ' test_cmp want body ' +# The plain page walks a path out of whatever commit the id names, and the +# 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) && + robq "url=rob/blob/file-1&id=$tip" >tmp && + strip_headers body && + test_cmp want body && + tag=$(git -C repos/rob rev-parse ann) && + robq "url=rob/blob/file-1&id=$tag" >tmp && + strip_headers body && + test_cmp want body && + robq "url=rob/blob/missing&id=$tip" >tmp && + grep "^Status: 404" tmp +' + test_expect_success 'the commit page shows a message whole when text follows its trailers' ' ( cd repos/rob && -- cgit v2.8.0