(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'git apply --whitespace=strip and configuration file.\n'> <'\n'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\tmkdir sub &&\n'> <'\techo A >sub/file1 &&\n'> <'\tcp sub/file1 saved &&\n'> <'\tgit add sub/file1 &&\n'> <'\techo "B " >sub/file1 &&\n'> <'\tgit diff >patch.file\n'> ) } ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(tr)} {(SQ <_>)} {(SQ <' '>)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(gpatch.file)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 67 stdin_parts: [ ('--- file1\t2007-02-21 01:04:24.000000000 -0800\n') ('+++ file1+\t2007-02-21 01:07:44.000000000 -0800\n') ('@@ -1 +1 @@\n') ('-A\n') ('+B_\n') ] ) ] ) (command.SimpleCommand words: [{(sed)} {(-e)} {(SQ <'s|file1|sub/&|'>)} {(gpatch.file)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(gpatch-sub.file)})] ) (command.SimpleCommand words: [ {(sed)} {(-e)} {(SQ <'\n'> <'\t/^--- /s|file1|a/sub/&|\n'> <'\t/^+++ /s|file1|b/sub/&|\n'>)} {(gpatch.file)} ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(gpatch-ab-sub.file)})] ) (command.FuncDef name: check_result body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(grep)} {(DQ (' '))} {(DQ ($ VSub_Number '$1'))})] action: [(C {(echo)} {(DQ ('Eh?'))}) (C {(false)})] ) (if_arm cond: [(C {(grep)} {(B)} {(DQ ($ VSub_Number '$1'))})] action: [(C {(echo)} {(Happy)})] ) ] else_action: [(C {(echo)} {(DQ ('Huh?'))}) (C {(false)})] ) ] ) ) ] ) (C {(test_expect_success)} {(SQ <'apply --whitespace=strip'>)} { (SQ <'\n'> <'\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tgit apply --whitespace=strip patch.file &&\n'> <'\tcheck_result sub/file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'apply --whitespace=strip from config'>)} { (SQ <'\n'> <'\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tgit config apply.whitespace strip &&\n'> <'\tgit apply patch.file &&\n'> <'\tcheck_result sub/file1\n'> ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:D) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(test_expect_success)} {(SQ <'apply --whitespace=strip in subdir'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config --unset-all apply.whitespace &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply --whitespace=strip ../patch.file &&\n'> <'\tcheck_result file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'apply --whitespace=strip from config in subdir'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply ../patch.file &&\n'> <'\tcheck_result file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'same in subdir but with traditional patch input'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply ../gpatch.file &&\n'> <'\tcheck_result file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'same but with traditional patch input of depth 1'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply ../gpatch-sub.file &&\n'> <'\tcheck_result file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'same but with traditional patch input of depth 2'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply ../gpatch-ab-sub.file &&\n'> <'\tcheck_result file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'same but with traditional patch input of depth 1'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tgit apply -p0 gpatch-sub.file &&\n'> <'\tcheck_result sub/file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'same but with traditional patch input of depth 2'>)} { (SQ <'\n'> <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tgit apply gpatch-ab-sub.file &&\n'> <'\tcheck_result sub/file1\n'> ) } ) (C {(test_expect_success)} {(SQ <'in subdir with traditional patch input'>)} { (SQ <'\n'> <'\tcd "$D" &&\n'> <'\tgit config apply.whitespace strip &&\n'> <'\tcat >.gitattributes <<-EOF &&\n'> <'\t/* whitespace=blank-at-eol\n'> <'\tsub/* whitespace=-blank-at-eol\n'> <'\tEOF\n'> <'\trm -f sub/file1 &&\n'> <'\tcp saved sub/file1 &&\n'> <'\tgit update-index --refresh &&\n'> <'\n'> <'\tcd sub &&\n'> <'\tgit apply ../gpatch.file &&\n'> <'\techo "B " >expect &&\n'> <'\ttest_cmp expect file1\n'> ) } ) (C {(test_done)}) ] )