(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description spids:[4]) op: Equal rhs: {(SQ <'apply same filename'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\n'> <'\tmkdir -p some/sub/dir &&\n'> <'\techo Hello > some/sub/dir/file &&\n'> <'\tgit add some/sub/dir/file &&\n'> <'\tgit commit -m initial &&\n'> <'\tgit tag initial\n'> <'\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(patch)}) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 50 stdin_parts: [ ('diff a/bla/blub/dir/file b/bla/blub/dir/file\n') ('--- a/bla/blub/dir/file\n') ('+++ b/bla/blub/dir/file\n') ('@@ -1,1 +1,1 @@\n') ('-Hello\n') ('+Bello\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'apply --directory -p (1)'>)} { (SQ <'\n'> <'\n'> <'\tgit apply --directory=some/sub -p3 --index patch &&\n'> <'\ttest Bello = $(git show :some/sub/dir/file) &&\n'> <'\ttest Bello = $(cat some/sub/dir/file)\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'apply --directory -p (2) '>)} { (SQ <'\n'> <'\n'> <'\tgit reset --hard initial &&\n'> <'\tgit apply --directory=some/sub/ -p3 --index patch &&\n'> <'\ttest Bello = $(git show :some/sub/dir/file) &&\n'> <'\ttest Bello = $(cat some/sub/dir/file)\n'> <'\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(patch)}) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 103 stdin_parts: [ ('diff --git a/newfile b/newfile\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ b/newfile\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'apply --directory (new file)'>)} { (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\tgit apply --directory=some/sub/dir/ --index patch &&\n'> <'\ttest content = $(git show :some/sub/dir/newfile) &&\n'> <'\ttest content = $(cat some/sub/dir/newfile)\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(patch)}) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 138 stdin_parts: [ ('diff --git a/c/newfile2 b/c/newfile2\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ b/c/newfile2\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'apply --directory -p (new file)'>)} { (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\tgit apply -p2 --directory=some/sub/dir/ --index patch &&\n'> <'\ttest content = $(git show :some/sub/dir/newfile2) &&\n'> <'\ttest content = $(cat some/sub/dir/newfile2)\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(patch)}) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 173 stdin_parts: [ ('diff --git a/delfile b/delfile\n') ('deleted file mode 100644\n') ('index d95f3ad..0000000\n') ('--- a/delfile\n') ('+++ /dev/null\n') ('@@ -1 +0,0 @@\n') ('-content\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'apply --directory (delete file)'>)} { (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\techo content >some/sub/dir/delfile &&\n'> <'\tgit add some/sub/dir/delfile &&\n'> <'\tgit apply --directory=some/sub/dir/ --index patch &&\n'> <'\t! (git ls-files | grep delfile)\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(patch)}) (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <EOF>)} here_end_span_id: 210 stdin_parts: [ ('diff --git "a/qu\\157tefile" "b/qu\\157tefile"\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ "b/qu\\157tefile"\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'apply --directory (quoted filename)'>)} { (SQ <'\n'> <'\tgit reset --hard initial &&\n'> <'\tgit apply --directory=some/sub/dir/ --index patch &&\n'> <'\ttest content = $(git show :some/sub/dir/quotefile) &&\n'> <'\ttest content = $(cat some/sub/dir/quotefile)\n'> ) } ) (C {(test_done)}) ] )