(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 <'prepare-commit-msg 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: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<fake-editor>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(SQ <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>} {<fake-editor>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'FAKE_EDITOR='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'FAKE_EDITOR='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FAKE_EDITOR='> name:FAKE_EDITOR)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Simple
                      blame_tok: <pwd>
                      more_env: []
                      words: [{<pwd>}]
                      redirects: []
                      do_fork: T
                    )
                  right: <Id.Eof_RParen _>
                ) <'/fake-editor'>
              )
            }
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <export>
      more_env: []
      words: [{<export>} {<FAKE_EDITOR>}]
      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) <'/prepare-commit-msg'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <mkdir>
      more_env: []
      words: [{<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName HOOKDIR))}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <echo>
      more_env: []
      words: [{<echo>} {(DQ <'#!'> ($ Id.VSub_DollarName SHELL_PATH))}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName HOOK))}
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir
          op: <Id.Redir_DGreat '>>'>
          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: {(SQ <EOF>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'\n'>
                <'if test "$2" = commit; then\n'>
                <'  source=$(git rev-parse "$3")\n'>
                <'else\n'>
                <'  source=${2-default}\n'>
                <'fi\n'>
                <'if test "$GIT_EDITOR" = :; then\n'>
                <'  sed -e "1s/.*/$source (no editor)/" "$1" > msg.tmp\n'>
                <'else\n'>
                <'  sed -e "1s/.*/$source/" "$1" > msg.tmp\n'>
                <'fi\n'>
                <'mv msg.tmp "$1"\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: <echo>
      more_env: []
      words: [{<echo>} {<dummy>} {<template>}]
      redirects: [
        (Redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: 
            {
              (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 _>
                ) <'/template'>
              )
            }
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-m)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit -m "more" &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = "message (no editor)"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-m editor)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tGIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit -e -m "more more" &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = message\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-t)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tgit commit -t "$(git rev-parse --git-dir)/template" &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = template\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-F)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\t(echo more | git commit -F -) &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = "message (no editor)"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-F editor)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\t(echo more more | GIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit -e -F -) &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = message\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-C)'>)}
        {
          (SQ <'\n'> <'\n'> <'\thead=$(git rev-parse HEAD) &&\n'> <'\techo "more" >> file &&\n'> 
            <'\tgit add file &&\n'> <'\tgit commit -C $head &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = "$head (no editor)"\n'> 
            <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (editor)'>)}
        {
          (SQ <'\n'> <'\n'> <'\techo "more more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\tGIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit &&\n'> <'\ttest "$(git log -1 --pretty=format:%s)" = default\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (--amend)'>)}
        {
          (SQ <'\n'> <'\n'> <'\thead=$(git rev-parse HEAD) &&\n'> <'\techo "more" >> file &&\n'> 
            <'\tgit add file &&\n'> <'\tGIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit --amend &&\n'> 
            <'\ttest "$(git log -1 --pretty=format:%s)" = "$head"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (-c)'>)}
        {
          (SQ <'\n'> <'\n'> <'\thead=$(git rev-parse HEAD) &&\n'> <'\techo "more" >> file &&\n'> 
            <'\tgit add file &&\n'> <'\tGIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit -c $head &&\n'> 
            <'\ttest "$(git log -1 --pretty=format:%s)" = "$head"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook (merge)'>)}
        {
          (SQ <'\n'> <'\n'> <'\ttest_when_finished "git checkout -f master" &&\n'> 
            <'\tgit checkout -B other HEAD@{1} &&\n'> <'\techo "more" >>file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m other &&\n'> 
            <'\tgit checkout - &&\n'> <'\tgit merge --no-ff other &&\n'> 
            <'\ttest "$(git log -1 --pretty=format:%s)" = "merge (no editor)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with hook and editor (merge)'>)}
        {
          (SQ <'\n'> <'\n'> <'\ttest_when_finished "git checkout -f master" &&\n'> 
            <'\tgit checkout -B other HEAD@{1} &&\n'> <'\techo "more" >>file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m other &&\n'> 
            <'\tgit checkout - &&\n'> <'\tenv GIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git merge --no-ff -e other &&\n'> 
            <'\ttest "$(git log -1 --pretty=format:%s)" = "merge"\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: {(SQ <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'> <'\ttest_when_finished "git checkout -f master" &&\n'> 
            <'\thead=$(git rev-parse HEAD) &&\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <'\ttest_must_fail env GIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit -c $head\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with failing hook (--no-verify)'>)}
        {
          (SQ <'\n'> <'\n'> <'\ttest_when_finished "git checkout -f master" &&\n'> 
            <'\thead=$(git rev-parse HEAD) &&\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> 
            <
'\ttest_must_fail env GIT_EDITOR="\\"\\$FAKE_EDITOR\\"" git commit --no-verify -c $head\n'
            > <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'with failing hook (merge)'>)}
        {
          (SQ <'\n'> <'\n'> <'\ttest_when_finished "git checkout -f master" &&\n'> 
            <'\tgit checkout -B other HEAD@{1} &&\n'> <'\techo "more" >> file &&\n'> <'\tgit add file &&\n'> <'\trm -f "$HOOK" &&\n'> 
            <'\tgit commit -m other &&\n'> <'\twrite_script "$HOOK" <<-EOF &&\n'> <'\texit 1\n'> <'\tEOF\n'> <'\tgit checkout - &&\n'> 
            <'\ttest_must_fail git merge --no-ff other\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)