diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
End a long directory chain on its last link
Past fifteen single directories the row stopped after writing the next separator, which left it ending in a dangling " / ".
Diffstat (limited to 'tests/t0104-tree.sh')
-rwxr-xr-xtests/t0104-tree.sh27
1 file changed, 27 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh
index a2ec3c2..e92b2a2 100755
--- a/tests/t0104-tree.sh
+++ b/tests/t0104-tree.sh
@@ -108,4 +108,31 @@ test_expect_success 'only a link target inside the tree is linked' '
! grep "href=./links/tree/etc/passwd" tmp
'
+# A row follows a chain of single directories for a set number of levels and
+# stops on the last one it links, with no separator left hanging after it.
+test_expect_success 'a long directory chain ends on a link' '
+ test_create_repo repos/deep &&
+ (
+ cd repos/deep &&
+ p=d1 &&
+ for i in $(test_seq 2 17)
+ do
+ p=$p/d$i || return 1
+ done &&
+ mkdir -p $p &&
+ echo deep >$p/file &&
+ git add . &&
+ git commit -m deep
+ ) &&
+ {
+ echo "virtual-root=/" &&
+ echo "cache-size=0" &&
+ echo "repo.url=deep" &&
+ echo "repo.path=$PWD/repos/deep/.git"
+ } >deeprc &&
+ CGIT_CONFIG="$PWD/deeprc" QUERY_STRING="url=deep/tree/" cgit >tmp &&
+ grep ">d15</a></td>" tmp &&
+ ! grep " / </td>" tmp
+'
+
test_done