X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4001-diff-rename.sh;h=063e79257a6e96d9021fa41d18a632560a272776;hb=71b0251cdd2cc35a983e21d4e71285db56d2a519;hp=2e3c20d6b9468bf413e97d422e7dbe13ac4238cd;hpb=acb725772964ee11656543a28c303e9aa6d092c5;p=git.git diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh index 2e3c20d6b..063e79257 100755 --- a/t/t4001-diff-rename.sh +++ b/t/t4001-diff-rename.sh @@ -28,21 +28,21 @@ Line 15 test_expect_success \ 'update-cache --add a file.' \ - 'git-update-index --add path0' + 'git update-index --add path0' test_expect_success \ 'write that tree.' \ - 'tree=$(git-write-tree) && echo $tree' + 'tree=$(git write-tree) && echo $tree' sed -e 's/line/Line/' path1 rm -f path0 test_expect_success \ 'renamed and edited the file.' \ - 'git-update-index --add --remove path0 path1' + 'git update-index --add --remove path0 path1' test_expect_success \ - 'git-diff-index -p -M after rename and editing.' \ - 'git-diff-index -p -M $tree >current' + 'git diff-index -p -M after rename and editing.' \ + 'git diff-index -p -M $tree >current' cat >expected <<\EOF diff --git a/path0 b/path1 rename from path0 @@ -64,4 +64,17 @@ test_expect_success \ 'validate the output.' \ 'compare_diff_patch current expected' +test_expect_success 'favour same basenames over different ones' ' + cp path1 another-path && + git add another-path && + git commit -m 1 && + git rm path1 && + mkdir subdir && + git mv another-path subdir/path1 && + git runstatus | grep "renamed: .*path1 -> subdir/path1"' + +test_expect_success 'favour same basenames even with minor differences' ' + git show HEAD:path1 | sed "s/15/16/" > subdir/path1 && + git runstatus | grep "renamed: .*path1 -> subdir/path1"' + test_done