Diff options
Diffstat (limited to 'tests/t0108-rawdiff.sh')
| -rwxr-xr-x | tests/t0108-rawdiff.sh | 21 |
1 file changed, 21 insertions, 0 deletions
diff --git a/tests/t0108-rawdiff.sh b/tests/t0108-rawdiff.sh index 9b4eb37..66f0cbe 100755 --- a/tests/t0108-rawdiff.sh +++ b/tests/t0108-rawdiff.sh @@ -52,4 +52,25 @@ test_expect_success 'a path limits the diff to that file' ' ! grep "file-5" actual ' +# The old name of a file renamed in the change joins the limit, so the diff +# shows the rename, the same as git diff given both names. +test_expect_success 'a renamed file is diffed 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 && + echo eleven >>new.txt && + git commit -am "rename old.txt" + ) && + cgitrc_repo movedrc moved && + cgit_rc movedrc "url=moved/rawdiff/new.txt" >tmp && + git -C repos/moved diff HEAD^ HEAD -- old.txt new.txt >expect && + strip_headers <tmp >actual && + test_cmp expect actual && + grep "^rename from old.txt$" actual +' + test_done |
