(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 <'paths written by git-apply cannot escape the working tree'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'bump git repo one level down'>)}
        {(SQ <'\n'> <'\tmkdir inside &&\n'> <'\tmv .git inside/ &&\n'> <'\tcd inside\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <mkpatch_add>
      name: mkpatch_add
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <rm>
                  more_env: []
                  words: [
                    {<rm>}
                    {<-f>}
                    {
                      (DQ 
                        (BracedVarSub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Number 2>
                          var_name: 2
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VTest_ColonHyphen _>
                              arg_word: {($ Id.VSub_Number 1)}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <cat>
                  more_env: []
                  words: [{<cat>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_DLessDash '<<-'>
                      loc: (redir_loc.Fd fd:0)
                      arg: 
                        (redir_param.HereDoc
                          here_begin: {<EOF>}
                          here_end_tok: <Id.Undefined_Tok ''>
                          stdin_parts: [
                            <'diff --git a/'>
                            ($ Id.VSub_Number 1)
                            <' b/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'new file mode 100644\n'>
                            <'index 0000000..53c74cd\n'>
                            <'--- /dev/null\n'>
                            <'+++ b/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'@@ -0,0 +1 @@\n'>
                            <'+evil\n'>
                          ]
                        )
                    )
                  ]
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <mkpatch_del>
      name: mkpatch_del
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {<evil>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: 
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Number 2>
                              var_name: 2
                              suffix_op: 
                                (suffix_op.Unary
                                  op: <Id.VTest_ColonHyphen _>
                                  arg_word: {($ Id.VSub_Number 1)}
                                )
                              right: <Id.Right_DollarBrace '}'>
                            )
                          )
                        }
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <cat>
                  more_env: []
                  words: [{<cat>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_DLessDash '<<-'>
                      loc: (redir_loc.Fd fd:0)
                      arg: 
                        (redir_param.HereDoc
                          here_begin: {<EOF>}
                          here_end_tok: <Id.Undefined_Tok ''>
                          stdin_parts: [
                            <'diff --git a/'>
                            ($ Id.VSub_Number 1)
                            <' b/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'deleted file mode 100644\n'>
                            <'index 53c74cd..0000000\n'>
                            <'--- a/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'+++ /dev/null\n'>
                            <'@@ -1 +0,0 @@\n'>
                            <'-evil\n'>
                          ]
                        )
                    )
                  ]
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <mkpatch_symlink>
      name: mkpatch_symlink
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <rm>
                  more_env: []
                  words: [{<rm>} {<-f>} {(DQ ($ Id.VSub_Number 1))}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <cat>
                  more_env: []
                  words: [{<cat>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_DLessDash '<<-'>
                      loc: (redir_loc.Fd fd:0)
                      arg: 
                        (redir_param.HereDoc
                          here_begin: {<EOF>}
                          here_end_tok: <Id.Undefined_Tok ''>
                          stdin_parts: [
                            <'diff --git a/'>
                            ($ Id.VSub_Number 1)
                            <' b/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'new file mode 120000\n'>
                            <'index 0000000..'>
                            (CommandSub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.Simple
                                      blame_tok: <printf>
                                      more_env: []
                                      words: [{<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Number 2))}]
                                      redirects: []
                                      do_fork: T
                                    )
                                    (command.Simple
                                      blame_tok: <git>
                                      more_env: []
                                      words: [{<git>} {<hash-object>} {<--stdin>}]
                                      redirects: []
                                      do_fork: T
                                    )
                                  ]
                                  ops: [<Id.Op_Pipe _>]
                                )
                              right: <Id.Eof_RParen _>
                            )
                            <'\n'>
                            <'--- /dev/null\n'>
                            <'+++ b/'>
                            ($ Id.VSub_Number 1)
                            <'\n'>
                            <'@@ -0,0 +1 @@\n'>
                            <'+'>
                            ($ Id.VSub_Number 2)
                            <'\n'>
                            <Id.Lit_BadBackslash '\\'>
                            <' No newline at end of file\n'>
                          ]
                        )
                    )
                  ]
                  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>}
        {(SQ <'cannot create file containing ..'>)}
        {
          (SQ <'\n'> <'\tmkpatch_add ../foo >patch &&\n'> <'\ttest_must_fail git apply patch &&\n'> 
            <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'can create file containing .. with --unsafe-paths'>)}
        {
          (SQ <'\n'> <'\tmkpatch_add ../foo >patch &&\n'> <'\tgit apply --unsafe-paths patch &&\n'> 
            <'\ttest_path_is_file ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cannot create file containing .. (index)'>)}
        {
          (SQ <'\n'> <'\tmkpatch_add ../foo >patch &&\n'> 
            <'\ttest_must_fail git apply --index patch &&\n'> <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cannot create file containing .. with --unsafe-paths (index)'>)}
        {
          (SQ <'\n'> <'\tmkpatch_add ../foo >patch &&\n'> 
            <'\ttest_must_fail git apply --index --unsafe-paths patch &&\n'> <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cannot delete file containing ..'>)}
        {
          (SQ <'\n'> <'\tmkpatch_del ../foo >patch &&\n'> <'\ttest_must_fail git apply patch &&\n'> 
            <'\ttest_path_is_file ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'can delete file containing .. with --unsafe-paths'>)}
        {
          (SQ <'\n'> <'\tmkpatch_del ../foo >patch &&\n'> <'\tgit apply --unsafe-paths patch &&\n'> 
            <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'cannot delete file containing .. (index)'>)}
        {
          (SQ <'\n'> <'\tmkpatch_del ../foo >patch &&\n'> 
            <'\ttest_must_fail git apply --index patch &&\n'> <'\ttest_path_is_file ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SYMLINKS>}
        {(SQ <'symlink escape via ..'>)}
        {
          (SQ <'\n'> <'\t{\n'> <'\t\tmkpatch_symlink tmp .. &&\n'> <'\t\tmkpatch_add tmp/foo ../foo\n'> 
            <'\t} >patch &&\n'> <'\ttest_must_fail git apply patch &&\n'> <'\ttest_path_is_missing tmp &&\n'> 
            <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SYMLINKS>}
        {(SQ <'symlink escape via .. (index)'>)}
        {
          (SQ <'\n'> <'\t{\n'> <'\t\tmkpatch_symlink tmp .. &&\n'> <'\t\tmkpatch_add tmp/foo ../foo\n'> 
            <'\t} >patch &&\n'> <'\ttest_must_fail git apply --index patch &&\n'> <'\ttest_path_is_missing tmp &&\n'> 
            <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SYMLINKS>}
        {(SQ <'symlink escape via absolute path'>)}
        {
          (SQ <'\n'> <'\t{\n'> <'\t\tmkpatch_symlink tmp "$(pwd)" &&\n'> 
            <'\t\tmkpatch_add tmp/foo ../foo\n'> <'\t} >patch &&\n'> <'\ttest_must_fail git apply patch &&\n'> <'\ttest_path_is_missing tmp &&\n'> 
            <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SYMLINKS>}
        {(SQ <'symlink escape via absolute path (index)'>)}
        {
          (SQ <'\n'> <'\t{\n'> <'\t\tmkpatch_symlink tmp "$(pwd)" &&\n'> 
            <'\t\tmkpatch_add tmp/foo ../foo\n'> <'\t} >patch &&\n'> <'\ttest_must_fail git apply --index patch &&\n'> 
            <'\ttest_path_is_missing tmp &&\n'> <'\ttest_path_is_missing ../foo\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)