Diff options
Diffstat (limited to 'tests/t0109-patch.sh')
| -rwxr-xr-x | tests/t0109-patch.sh | 19 |
1 file changed, 19 insertions, 0 deletions
diff --git a/tests/t0109-patch.sh b/tests/t0109-patch.sh index bc942fe..6aae556 100755 --- a/tests/t0109-patch.sh +++ b/tests/t0109-patch.sh @@ -70,4 +70,23 @@ test_expect_success 'the signature names the version when asked to' ' check_cgit_signature "$CGIT_VERSION" ' +# The old name of a file renamed in the commit joins the limit, so the patch +# carries the rename rather than a file added whole. +test_expect_success 'a renamed file is patched as the rename' ' + mkrepo repos/moved 1 && + ( + cd repos/moved && + test_seq 1 10 >old.txt && + git add old.txt && + git commit -m "add old.txt" && + git mv old.txt new.txt && + git commit -m "rename old.txt" + ) && + cgitrc_repo movedrc moved && + cgit_rc movedrc "url=moved/patch/new.txt" >tmp && + grep "^rename from old.txt$" tmp && + grep "^rename to new.txt$" tmp && + ! grep "^new file mode" tmp +' + test_done |
