Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Head the tag table's column for what it holds
| -rw-r--r-- | source/ui-refs.c | 6 | |
| -rwxr-xr-x | 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( "<tbody class='tags'>\n" "<tr class='nohover'><th class='left' scope='col'>Tag</th>" - "<th class='left' scope='col'>Download</th>" - "<th class='left col-author' scope='col'>Author</th>" ); + // Without a snapshot format the column holds what each tag points at. + htmlf("<th class='left' scope='col'>%s</th>", + ctx.repo->snapshots ? "Download" : "Commit"); + html("<th class='left col-author' scope='col'>Author</th>"); htmlf("<th%s class='left' scope='col'>Age</th></tr>\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 "<th class=.left. scope=.col.>Tag</th><th class=.left. scope=.col.>Commit</th>" tmp && + { + echo "snapshots=tar" && + cat colsrc + } >snaprc && + cgit_rc snaprc "url=none/refs/" >tmp && + grep "<th class=.left. scope=.col.>Tag</th><th class=.left. scope=.col.>Download</th>" tmp +' + test_done |
