X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4001-diff-rename.sh;h=063e79257a6e96d9021fa41d18a632560a272776;hb=71b0251cdd2cc35a983e21d4e71285db56d2a519;hp=08c11319a70be6dfbcc530d9462c36254a3acd8e;hpb=9acf322d69f54ff5bf9de8b2d6f9cd1dccf523a3;p=git.git diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh index 08c11319a..063e79257 100755 --- a/t/t4001-diff-rename.sh +++ b/t/t4001-diff-rename.sh @@ -28,28 +28,28 @@ 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 rename to path1 --- a/path0 +++ b/path1 -@@ -8,7 +8,7 @@ +@@ -8,7 +8,7 @@ Line 7 Line 8 Line 9 Line 10 @@ -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