Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0102-summary.sh | 29 |
1 file changed, 29 insertions, 0 deletions
diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh index e95f270..7df18e4 100755 --- a/tests/t0102-summary.sh +++ b/tests/t0102-summary.sh @@ -51,6 +51,35 @@ test_expect_success 'an scp clone url row links to the http url' ' ! grep "vcs-git. href=.git@" tmp ' +# A repository can turn the global clone-url off with an empty one of its own. +# Neither its summary nor the page an empty repository gets then draws a Clone +# heading over no rows. +test_expect_success 'an empty clone url draws no clone heading' ' + git init -q --bare repos/empty.git && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "clone-url=https://example.org/\$CGIT_REPO_URL" && + echo "repo.url=foo" && + echo "repo.path=$PWD/repos/foo/.git" && + echo "repo.clone-url=" && + echo "repo.url=empty" && + echo "repo.path=$PWD/repos/empty.git" && + echo "repo.clone-url=" && + echo "repo.url=cloned" && + echo "repo.path=$PWD/repos/empty.git" + } >emptyrc && + CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=foo" cgit >tmp && + grep "commit 1" tmp && + ! grep "Clone</th>" tmp && + CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=empty" cgit >tmp && + grep "Repository seems to be empty" tmp && + ! grep "Clone</th>" tmp && + CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=cloned" cgit >tmp && + grep "Clone</th>" tmp && + grep "https://example.org/cloned</a>" tmp +' + # Prints how many columns each row of the page's list table spans, one row to # a line, counting a cell without a colspan as one. row_widths() { |
