Diff options
Diffstat (limited to 'tests/t0101-index.sh')
| -rwxr-xr-x | tests/t0101-index.sh | 26 |
1 file changed, 26 insertions, 0 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index 9b02a18..0953b8d 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -93,4 +93,30 @@ test_expect_success 'a scan lists repositories in path order' ' test_cmp expect order ' +# A repository listed without repo.desc shows the first line of its own +# description file, as a scanned one does. A repo.desc after the repo.path +# still wins, and git's placeholder still reads as no description. +test_expect_success 'a repository without repo.desc reads its description file' ' + mkrepo repos/described 1 && + printf "told by the file\nsecond line\n" >repos/described/.git/description && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "repo.url=described" && + echo "repo.path=$PWD/repos/described/.git" && + echo "repo.url=overridden" && + echo "repo.path=$PWD/repos/described/.git" && + echo "repo.desc=from cgitrc" && + echo "repo.url=placeholder" && + echo "repo.path=$PWD/repos/foo/.git" + } >describedrc && + cgit_rc describedrc "url=" >tmp && + grep "href=./described/.>told by the file</a>" tmp && + grep "href=./overridden/.>from cgitrc</a>" tmp && + grep "href=./placeholder/.>\[no description\]</a>" tmp && + ! grep "second line" tmp && + cgit_rc describedrc "url=described/" >tmp && + grep "<meta name=.description. content=.told by the file.>" tmp +' + test_done |
