Diff options
Diffstat (limited to 'tests/t0104-tree.sh')
| -rwxr-xr-x | tests/t0104-tree.sh | 21 |
1 file changed, 21 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 754b3e1..9d6e542 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -95,6 +95,27 @@ test_expect_success 'the folder crumbs of a blame page lead to the tree' ' grep "path: <a href=./nested/tree/.>root</a>/<a href=./nested/tree/a.>a</a>/<a href=./nested/tree/a/b.>b</a>/<a href=./nested/blame/a/b/file.txt.>file.txt</a>" tmp ' +# A commit's lines link to the file as the parent had it, under the name it +# had there, and the commit that created the file has nothing to link to. +test_expect_success 'blame links a commit to the file before it' ' + mkrepo repos/renamed 1 && + ( + cd repos/renamed && + test_seq 1 10 >a.txt && + git add a.txt && + git commit -m "add a.txt" && + git mv a.txt b.txt && + test_seq 1 9 >b.txt && + echo ten >>b.txt && + git commit -am "rename a.txt" + ) && + cgitrc_repo renamedrc renamed enable-blame=1 && + cgit_rc renamedrc "url=renamed/blame/b.txt" >tmp && + added=$(git -C repos/renamed rev-parse HEAD~1) && + grep "title=.Blame the previous revision. href=./renamed/blame/a.txt?id=$added.>^</a>" tmp && + test $(grep -c "Blame the previous revision" tmp) = 1 +' + test_expect_success 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >tmp' test_expect_success 'verify a+b link' ' |
