Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test a link target that climbs above the root
Only an absolute target was tested, so ignoring a failed normalisation
passed, and the mutation run left that change alive.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0104-tree.sh | 8 |
1 file changed, 6 insertions, 2 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 5df20b2..4cb1c06 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -207,7 +207,8 @@ test_expect_success 'a submodule path is answered with the submodule' ' ' # A link target inside the tree becomes a link, while an absolute one names a -# file on whatever machine checks the tree out, not a path in the tree. +# file on whatever machine checks the tree out, not a path in the tree, and +# so does one that climbs above the root. test_expect_success 'only a link target inside the tree is linked' ' test_create_repo repos/links && ( @@ -216,15 +217,18 @@ test_expect_success 'only a link target inside the tree is linked' ' git add target.txt && rel=$(printf target.txt | git hash-object -w --stdin) && abs=$(printf /etc/passwd | git hash-object -w --stdin) && + up=$(printf ../outside | git hash-object -w --stdin) && git update-index --add --cacheinfo 120000,$rel,rel && git update-index --add --cacheinfo 120000,$abs,abs && + git update-index --add --cacheinfo 120000,$up,up && git commit -m links ) && cgitrc_repo linksrc links && cgit_ok linksrc "url=links/tree/" >tmp && grep " -> <a class=.ls-blob. href=./links/tree/target.txt.>target.txt</a>" tmp && grep " -> /etc/passwd</td>" tmp && - test_grep ! "href=./links/tree/etc/passwd" tmp + test_grep ! "href=./links/tree/etc/passwd" tmp && + test_grep " -> \.\./outside</td>" tmp ' # Blame takes a regular file alone, so a symlink is not offered it. The |
