From e0cb8047a81abc8b9d9dbf864c33874cd094b899 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:31:04 -1000 Subject: Share the rename fixture of the diff pages Each repository is built tree for tree as before. A helper that lost the caller's change would still fail t0107, where following no path shows file-1, but t0108 passed without its added line, so it now looks for that line. --- tests/setup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/setup.sh') diff --git a/tests/setup.sh b/tests/setup.sh index ac6e293..a43bf01 100644 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -199,6 +199,23 @@ mkrepo() { ) } +# Creates a repository holding mkrepo's one commit, then a commit adding +# old.txt with ten numbered lines and one renaming it to new.txt. A command +# given second runs in the repository just before the rename is committed, +# so a test can put changes of its own into that commit. +mkrepo_renamed() { + mkrepo "$1" 1 && + ( + cd "$1" && + test_seq 1 10 >old.txt && + git add old.txt && + git commit -m "add old.txt" && + git mv old.txt new.txt && + eval "$2" && + git commit -am "rename old.txt" + ) +} + setup_repos() { mkdir cache && mkrepo repos/foo 5 >/dev/null && -- cgit 2.12.1