Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests/setup.sh')
| -rw-r--r-- | tests/setup.sh | 17 |
1 file changed, 17 insertions, 0 deletions
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 && |
