(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'apply same filename'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <modify>
      name: modify
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <sed>
                  more_env: []
                  words: [{<sed>} {<-e>} {(DQ ($ Id.VSub_Number 1))}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {(DQ ($ Id.VSub_Number 2))}
                    )
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_Number 2)) <.x>}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <mv>
                  more_env: []
                  words: [{<mv>} {(DQ ($ Id.VSub_Number 2)) <.x>} {(DQ ($ Id.VSub_Number 2))}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\tfor i in a b c d e f g h i j k l m\n'> <'\tdo\n'> <'\t\techo $i\n'> 
            <'\tdone >same_fn &&\n'> <'\tcp same_fn other_fn &&\n'> <'\tgit add same_fn other_fn &&\n'> <'\tgit commit -m initial\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'apply same filename with independent changes'>)}
        {
          (SQ <'\n'> <'\tmodify "s/^d/z/" same_fn &&\n'> <'\tgit diff > patch0 &&\n'> 
            <'\tgit add same_fn &&\n'> <'\tmodify "s/^i/y/" same_fn &&\n'> <'\tgit diff >> patch0 &&\n'> <'\tcp same_fn same_fn2 &&\n'> 
            <'\tgit reset --hard &&\n'> <'\tgit apply patch0 &&\n'> <'\ttest_cmp same_fn same_fn2\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'apply same filename with overlapping changes'>)}
        {
          (SQ <'\n'> <'\tgit reset --hard &&\n'> <'\tmodify "s/^d/z/" same_fn &&\n'> 
            <'\tgit diff > patch0 &&\n'> <'\tgit add same_fn &&\n'> <'\tmodify "s/^e/y/" same_fn &&\n'> <'\tgit diff >> patch0 &&\n'> 
            <'\tcp same_fn same_fn2 &&\n'> <'\tgit reset --hard &&\n'> <'\tgit apply patch0 &&\n'> <'\ttest_cmp same_fn same_fn2\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'apply same new filename after rename'>)}
        {
          (SQ <'\n'> <'\tgit reset --hard &&\n'> <'\tgit mv same_fn new_fn &&\n'> 
            <'\tmodify "s/^d/z/" new_fn &&\n'> <'\tgit add new_fn &&\n'> <'\tgit diff -M --cached > patch1 &&\n'> <'\tmodify "s/^e/y/" new_fn &&\n'> 
            <'\tgit diff >> patch1 &&\n'> <'\tcp new_fn new_fn2 &&\n'> <'\tgit reset --hard &&\n'> <'\tgit apply --index patch1 &&\n'> 
            <'\ttest_cmp new_fn new_fn2\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'apply same old filename after rename -- should fail.'>)}
        {
          (SQ <'\n'> <'\tgit reset --hard &&\n'> <'\tgit mv same_fn new_fn &&\n'> 
            <'\tmodify "s/^d/z/" new_fn &&\n'> <'\tgit add new_fn &&\n'> <'\tgit diff -M --cached > patch1 &&\n'> <'\tgit mv new_fn same_fn &&\n'> 
            <'\tmodify "s/^e/y/" same_fn &&\n'> <'\tgit diff >> patch1 &&\n'> <'\tgit reset --hard &&\n'> <'\ttest_must_fail git apply patch1\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'apply A->B (rename), C->A (rename), A->A -- should pass.'>)}
        {
          (SQ <'\n'> <'\tgit reset --hard &&\n'> <'\tgit mv same_fn new_fn &&\n'> 
            <'\tmodify "s/^d/z/" new_fn &&\n'> <'\tgit add new_fn &&\n'> <'\tgit diff -M --cached > patch1 &&\n'> <'\tgit commit -m "a rename" &&\n'> 
            <'\tgit mv other_fn same_fn &&\n'> <'\tmodify "s/^e/y/" same_fn &&\n'> <'\tgit add same_fn &&\n'> 
            <'\tgit diff -M --cached >> patch1 &&\n'> <'\tmodify "s/^g/x/" same_fn &&\n'> <'\tgit diff >> patch1 &&\n'> <'\tgit reset --hard HEAD^ &&\n'> 
            <'\tgit apply patch1\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)