(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"rewrite diff">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\n"> <"\tcat \"$TEST_DIRECTORY\"/../COPYING >test &&\n"> <"\tgit add test &&\n"> <"\ttr \\\n"> <"\t \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\" \\\n"> <"\t \"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM\" \\\n"> <"\t <\"$TEST_DIRECTORY\"/../COPYING >test &&\n"> <"\techo \"to be deleted\" >test2 &&\n"> <"\tgit add test2\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"detect rewrite">)} { (SQ <"\n"> <"\n"> <"\tactual=$(git diff-files -B --summary test) &&\n"> <"\tverbose expr \"$actual\" : \" rewrite test ([0-9]*%)$\"\n"> <"\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[51]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("diff --git a/test2 b/test2\n") ("deleted file mode 100644\n") ("index 4202011..0000000\n") ("--- a/test2\n") ("+++ /dev/null\n") ("@@ -1 +0,0 @@\n") ("-to be deleted\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [54] ) ] ) (C {(test_expect_success)} {(SQ <"show deletion diff without -D">)} { (SQ <"\n"> <"\n"> <"\trm test2 &&\n"> <"\tgit diff -- test2 >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[81]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("diff --git a/test2 b/test2\n") ("deleted file mode 100644\n") ("index 4202011..0000000\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [84] ) ] ) (C {(test_expect_success)} {(SQ <"suppress deletion diff with -D">)} {(SQ <"\n"> <"\n"> <"\tgit diff -D -- test2 >actual &&\n"> <"\ttest_cmp expect actual\n">)} ) (C {(test_expect_success)} {(SQ <"show deletion diff with -B">)} { (SQ <"\n"> <"\n"> <"\tgit diff -B -- test >actual &&\n"> <"\tgrep \"Linus Torvalds\" actual\n">) } ) (C {(test_expect_success)} {(SQ <"suppress deletion diff with -B -D">)} { (SQ <"\n"> <"\n"> <"\tgit diff -B -D -- test >actual &&\n"> <"\tgrep -v \"Linus Torvalds\" actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"prepare a file that ends with an incomplete line">)} { (SQ <"\n"> <"\ttest_seq 1 99 >seq &&\n"> <"\tprintf 100 >>seq &&\n"> <"\tgit add seq &&\n"> <"\tgit commit seq -m seq\n"> ) } ) (C {(test_expect_success)} {(SQ <"rewrite the middle 90% of sequence file and terminate with newline">)} { (SQ <"\n"> <"\ttest_seq 1 5 >seq &&\n"> <"\ttest_seq 9331 9420 >>seq &&\n"> <"\ttest_seq 96 100 >>seq\n"> ) } ) (C {(test_expect_success)} {(SQ <"confirm that sequence file is considered a rewrite">)} {(SQ <"\n"> <"\tgit diff -B seq >res &&\n"> <"\tgrep \"dissimilarity index\" res\n">)} ) (C {(test_expect_success)} {(SQ <"no newline at eof is on its own line without -B">)} { (SQ <"\n"> <"\tgit diff seq >res &&\n"> <"\tgrep \"^\\\\\\\\ \" res &&\n"> <"\t! grep \"^..*\\\\\\\\ \" res\n"> ) } ) (C {(test_expect_success)} {(SQ <"no newline at eof is on its own line with -B">)} { (SQ <"\n"> <"\tgit diff -B seq >res &&\n"> <"\tgrep \"^\\\\\\\\ \" res &&\n"> <"\t! grep \"^..*\\\\\\\\ \" res\n"> ) } ) (C {(test_done)}) ] )