X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4008-diff-break-rewrite.sh;h=7e343a9cd130a73547ed1df9a4d9cd364e60bf9f;hb=baede9f803ff7becab815481b004bc983d0422c7;hp=263ac1ebf7d5ef2fa6b278c4a6694d369c283f88;hpb=070739fd351702ea9bb4f65595728ae25a488075;p=git.git diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh index 263ac1ebf..7e343a9cd 100755 --- a/t/t4008-diff-break-rewrite.sh +++ b/t/t4008-diff-break-rewrite.sh @@ -22,25 +22,25 @@ four changes in total. Further, with -B and -M together, these should turn into two renames. ' . ./test-lib.sh -. ../diff-lib.sh ;# test-lib chdir's into trash +. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash test_expect_success \ setup \ - 'cat ../../README >file0 && - cat ../../COPYING >file1 && - git-update-index --add file0 file1 && - tree=$(git-write-tree) && + 'cat "$TEST_DIRECTORY"/../README >file0 && + cat "$TEST_DIRECTORY"/../COPYING >file1 && + git update-index --add file0 file1 && + tree=$(git write-tree) && echo "$tree"' test_expect_success \ 'change file1 with copy-edit of file0 and remove file0' \ 'sed -e "s/git/GIT/" file0 >file1 && rm -f file0 && - git-update-index --remove file0 file1' + git update-index --remove file0 file1' test_expect_success \ 'run diff with -B' \ - 'git-diff-index -B --cached "$tree" >current' + 'git diff-index -B --cached "$tree" >current' cat >expected <<\EOF :100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0 @@ -53,7 +53,7 @@ test_expect_success \ test_expect_success \ 'run diff with -B and -M' \ - 'git-diff-index -B -M "$tree" >current' + 'git diff-index -B -M "$tree" >current' cat >expected <<\EOF :100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c R100 file0 file1 @@ -66,16 +66,16 @@ test_expect_success \ test_expect_success \ 'swap file0 and file1' \ 'rm -f file0 file1 && - git-read-tree -m $tree && - git-checkout-index -f -u -a && + git read-tree -m $tree && + git checkout-index -f -u -a && mv file0 tmp && mv file1 file0 && mv tmp file1 && - git-update-index file0 file1' + git update-index file0 file1' test_expect_success \ 'run diff with -B' \ - 'git-diff-index -B "$tree" >current' + 'git diff-index -B "$tree" >current' cat >expected <<\EOF :100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100 file0 @@ -88,7 +88,7 @@ test_expect_success \ test_expect_success \ 'run diff with -B and -M' \ - 'git-diff-index -B -M "$tree" >current' + 'git diff-index -B -M "$tree" >current' cat >expected <<\EOF :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100 file1 file0 @@ -103,11 +103,11 @@ test_expect_success \ 'make file0 into something completely different' \ 'rm -f file0 && ln -s frotz file0 && - git-update-index file0 file1' + git update-index file0 file1' test_expect_success \ 'run diff with -B' \ - 'git-diff-index -B "$tree" >current' + 'git diff-index -B "$tree" >current' cat >expected <<\EOF :100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0 @@ -119,14 +119,14 @@ test_expect_success \ 'compare_diff_raw expected current' test_expect_success \ - 'run diff with -B' \ - 'git-diff-index -B -M "$tree" >current' + 'run diff with -B -M' \ + 'git diff-index -B -M "$tree" >current' -# This should not mistake file0 as the copy source of new file1 -# due to type differences. +# file0 changed from regular to symlink. file1 is very close to the preimage of file0. +# because we break file0, file1 can become a rename of it. cat >expected <<\EOF :100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0 -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1 +:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R file0 file1 EOF test_expect_success \ @@ -135,7 +135,7 @@ test_expect_success \ test_expect_success \ 'run diff with -M' \ - 'git-diff-index -M "$tree" >current' + 'git diff-index -M "$tree" >current' # This should not mistake file0 as the copy source of new file1 # due to type differences. @@ -151,16 +151,16 @@ test_expect_success \ test_expect_success \ 'file1 edited to look like file0 and file0 rename-edited to file2' \ 'rm -f file0 file1 && - git-read-tree -m $tree && - git-checkout-index -f -u -a && + git read-tree -m $tree && + git checkout-index -f -u -a && sed -e "s/git/GIT/" file0 >file1 && sed -e "s/git/GET/" file0 >file2 && rm -f file0 - git-update-index --add --remove file0 file1 file2' + git update-index --add --remove file0 file1 file2' test_expect_success \ 'run diff with -B' \ - 'git-diff-index -B "$tree" >current' + 'git diff-index -B "$tree" >current' cat >expected <<\EOF :100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0 @@ -174,7 +174,7 @@ test_expect_success \ test_expect_success \ 'run diff with -B -M' \ - 'git-diff-index -B -M "$tree" >current' + 'git diff-index -B -M "$tree" >current' cat >expected <<\EOF :100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c C095 file0 file1