(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git apply --whitespace=strip and configuration file.\n'> <'\n'>)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (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'>
        )
      }
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(tr)} {(SQ <_>)} {(SQ <' '>)}]
          redirects: [
            (Redir op_id:Redir_Great fd:16777215 arg_word:{(gpatch.file)} spids:[53])
            (HereDoc
              op_id: Redir_DLess
              fd: 16777215
              body: 
                {('--- 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')
                }
              do_expansion: False
              here_end: EOF
              was_filled: True
              spids: [56]
            )
          ]
        )
        (AndOr
          children: [
            (SimpleCommand
              words: [{(sed)} {(-e)} {(SQ <'s|file1|sub/&|'>)} {(gpatch.file)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(gpatch-sub.file)}
                  spids: [73]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(sed)}
                    {(-e)}
                    {(SQ <'\n'> <'\t/^--- /s|file1|a/sub/&|\n'> <'\t/^+++ /s|file1|b/sub/&|\n'>)}
                    {(gpatch.file)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(gpatch-ab-sub.file)}
                      spids: [90]
                    )
                  ]
                )
                (FuncDef
                  name: check_result
                  body: 
                    (BraceGroup
                      children: [
                        (If
                          arms: [
                            (if_arm
                              cond: [(C {(grep)} {(DQ (' '))} {(DQ ($ VSub_Number '$1'))})]
                              action: [(C {(echo)} {(DQ ('Eh?'))}) (C {(false)})]
                              spids: [16777215 117]
                            )
                            (if_arm
                              cond: [(C {(grep)} {(B)} {(DQ ($ VSub_Number '$1'))})]
                              action: [(C {(echo)} {(Happy)})]
                              spids: [130 141]
                            )
                          ]
                          else_action: [(C {(echo)} {(DQ ('Huh?'))}) (C {(false)})]
                          spids: [149 162]
                        )
                      ]
                      spids: [101]
                    )
                  spids: [96 100]
                )
              ]
              op_id: Op_DAmp
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (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'>
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:D)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(pwd)})])
                left_token: <Left_CommandSub '$('>
                spids: [205 207]
              )
            }
          spids: [204]
        )
      ]
      spids: [204]
    )
    (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)})
  ]
)