From fa871b31f6c3309d3c3d0b4bebcd5b5b62706f0a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 29 Aug 2026 15:50:14 -1000 Subject: Point clone rows at a url a browser can follow --- tests/t0102-summary.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/t0102-summary.sh') diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh index 79f2b11..5ce1fab 100755 --- a/tests/t0102-summary.sh +++ b/tests/t0102-summary.sh @@ -32,4 +32,25 @@ test_expect_success 'clone-url expanded correctly' ' grep "git://example.org/bar.git" tmp ' +# A clone url is shown as written, but a browser cannot follow the ssh, scp +# or git forms, so those rows link to the first http url in the list, or to +# the repository's own page when the list has none. +test_expect_success 'a git clone url row falls back to the page url' ' + grep "clone-url.>git://example.org/bar.git" tmp +' + +test_expect_success 'an scp clone url row links to the http url' ' + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "repo.url=foo" && + echo "repo.path=$PWD/repos/foo/.git" && + echo "repo.clone-url=git@example.org:foo https://example.org/foo" + } >clonerc && + CGIT_CONFIG="$PWD/clonerc" QUERY_STRING="url=foo" cgit >tmp && + grep "title=.foo Git repository. href=.https://example.org/foo.>git@example.org:foo" tmp && + grep "vcs-git. href=.https://example.org/foo." tmp && + ! grep "vcs-git. href=.git@" tmp +' + test_done -- cgit v2.8.0