(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'rewrite diff'>)} spids: [4] ) ] redirects: [] ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 65 stdin_parts: [ <'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'> ] ) ) ] more_env: [] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 93 stdin_parts: [ <'diff --git a/test2 b/test2\n'> <'deleted file mode 100644\n'> <'index 4202011..0000000\n'> ] ) ) ] more_env: [] do_fork: T ) (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>}) ] )