From da4ece9db2984d99b33d15e15cd87cb009246ac2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 1 Nov 2026 11:01:53 -1000 Subject: Blame the previous revision under its own name --- tests/t0104-tree.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/t0104-tree.sh') 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: root/a/b/file.txt" 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.>^" 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' ' -- cgit 2.12.1