(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 <'pre-commit hook'>)}
        )
      ]
      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 <'with no hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "foo" > file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit -m "first"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'--no-verify with no hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "bar" > file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit --no-verify -m "bar"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'HOOKDIR='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'HOOKDIR='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'HOOKDIR='> name:HOOKDIR)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<rev-parse>} {<--git-dir>}]
                      redirects: []
                      do_fork: T
                    )
                  right: <Id.Eof_RParen _>
                ) <'/hooks'>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'HOOK='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'HOOK='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'HOOK='> name:HOOK)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName HOOKDIR) <'/pre-commit'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <mkdir>
      more_env: []
      words: [{<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName HOOKDIR))}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName HOOK))}
        )
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [<'#!/bin/sh\n'> <'exit 0\n'>]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <chmod>
      more_env: []
      words: [{<chmod>} {<Id.Lit_Other '+'> <x>} {(DQ ($ Id.VSub_DollarName HOOK))}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with succeeding hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit -m "more"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'--no-verify with succeeding hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "even more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit --no-verify -m "even more"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName HOOK))}
        )
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [<'#!/bin/sh\n'> <'exit 1\n'>]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with failing hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "another" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\ttest_must_fail git commit -m "another"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'--no-verify with failing hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "stuff" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit --no-verify -m "stuff"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <chmod>
      more_env: []
      words: [{<chmod>} {<-x>} {(DQ ($ Id.VSub_DollarName HOOK))}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<POSIXPERM>}
        {(SQ <'with non-executable hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "content" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit -m "content"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<POSIXPERM>}
        {(SQ <'--no-verify with non-executable hook'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more content" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit --no-verify -m "more content"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <chmod>
      more_env: []
      words: [{<chmod>} {<Id.Lit_Other '+'> <x>} {(DQ ($ Id.VSub_DollarName HOOK))}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName HOOK))}
        )
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'#!/bin/sh\n'>
                <'test '>
                (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$')
                <'GIT_PREFIX = success/\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook requiring GIT_PREFIX'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more content" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tmkdir success &&\n'> <'\t(\n'> <'\t\tcd success &&\n'> <'\t\tgit commit -m "hook requires GIT_PREFIX = success/"\n'> 
            <'\t) &&\n'> <'\trmdir success\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with failing hook requiring GIT_PREFIX'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more content" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tmkdir fail &&\n'> <'\t(\n'> <'\t\tcd fail &&\n'> <'\t\ttest_must_fail git commit -m "hook must fail"\n'> <'\t) &&\n'> 
            <'\trmdir fail &&\n'> <'\tgit checkout -- file\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'check the author in hook'>)}
        {
          (SQ <'\n'> <'\twrite_script "$HOOK" <<-\\EOF &&\n'> 
            <'\ttest "$GIT_AUTHOR_NAME" = "New Author" &&\n'> <'\ttest "$GIT_AUTHOR_EMAIL" = "newauthor@example.com"\n'> <'\tEOF\n'> 
            <'\ttest_must_fail git commit --allow-empty -m "by a.u.thor" &&\n'> <'\t(\n'> <'\t\tGIT_AUTHOR_NAME="New Author" &&\n'> 
            <'\t\tGIT_AUTHOR_EMAIL="newauthor@example.com" &&\n'> <'\t\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL &&\n'> 
            <'\t\tgit commit --allow-empty -m "by new.author via env" &&\n'> <'\t\tgit show -s\n'> <'\t) &&\n'> <'\tgit commit --author="New Author <newauthor@example.com>" \\\n'> 
            <'\t\t--allow-empty -m "by new.author via command line" &&\n'> <'\tgit show -s\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)