From feda3080315959564928008e562c72afcca43da5 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 1 Nov 2026 18:04:57 -1000 Subject: Head the tag table's column for what it holds --- source/ui-refs.c | 6 ++++-- tests/t0102-summary.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/ui-refs.c b/source/ui-refs.c index 69a2cc1..5a1ebf8 100644 --- a/source/ui-refs.c +++ b/source/ui-refs.c @@ -211,9 +211,11 @@ static void print_tag_header(int columns) html( "\n" "Tag" - "Download" - "Author" ); + // Without a snapshot format the column holds what each tag points at. + htmlf("%s", + ctx.repo->snapshots ? "Download" : "Commit"); + html("Author"); htmlf("Age\n", age_colspan(columns)); } diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh index 9e0e14c..c623202 100755 --- a/tests/t0102-summary.sh +++ b/tests/t0102-summary.sh @@ -146,4 +146,17 @@ test_expect_success 'the refs page fills four columns' 'test_widths both/refs/ 4 test_expect_success 'a page of branches fills four columns' 'test_widths both/refs/heads 4' test_expect_success 'a page of tags fills four columns' 'test_widths both/refs/tags 4' +# The tag table's second column holds the downloads, or with no snapshot +# format the object each tag points at, and is headed for what it holds. +test_expect_success 'the tag table heads its second column for what it holds' ' + cgit_rc colsrc "url=none/refs/" >tmp && + grep "TagCommit" tmp && + { + echo "snapshots=tar" && + cat colsrc + } >snaprc && + cgit_rc snaprc "url=none/refs/" >tmp && + grep "TagDownload" tmp +' + test_done -- cgit 2.12.1