(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'Test the post-merge hook.' span_id:15))}
          spids: [13]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:28) 
          (Token id:Id.Lit_Chars val:'\techo Data for commit0. >a &&\n' span_id:29) (Token id:Id.Lit_Chars val:'\tgit update-index --add a &&\n' span_id:30) 
          (Token id:Id.Lit_Chars val:'\ttree0=$(git write-tree) &&\n' span_id:31) (Token id:Id.Lit_Chars val:'\tcommit0=$(echo setup | git commit-tree $tree0) &&\n' span_id:32) 
          (Token id:Id.Lit_Chars val:'\techo Changed data for commit1. >a &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\tgit update-index a &&\n' span_id:34) 
          (Token id:Id.Lit_Chars val:'\ttree1=$(git write-tree) &&\n' span_id:35) 
          (Token
            id: Id.Lit_Chars
            val: '\tcommit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&\n'
            span_id: 36
          ) (Token id:Id.Lit_Chars val:'        git update-ref refs/heads/master $commit0 &&\n' span_id:37) 
          (Token id:Id.Lit_Chars val:'\tgit clone ./. clone1 &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\tGIT_DIR=clone1/.git git update-index --add a &&\n' span_id:39) 
          (Token id:Id.Lit_Chars val:'\tgit clone ./. clone2 &&\n' span_id:40) (Token id:Id.Lit_Chars val:'\tGIT_DIR=clone2/.git git update-index --add a\n' span_id:41)
        )
      }
    )
    (command.ForEach
      iter_name: clone
      iter_words: [{(1)} {(2)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:61)
                  fd: -1
                  arg_word: {(clone) (${ Id.VSub_Name clone) (/.git/hooks/post-merge)}
                )
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:68)
                  fd: -1
                  here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:70))}
                  here_end_span_id: 75
                  stdin_parts: [('#!/bin/sh\n') ('echo $@ >> $GIT_DIR/post-merge.args\n')]
                )
              ]
            )
            (C {(chmod)} {(u) (Id.Lit_Other '+') (x)} 
              {(clone) (${ Id.VSub_Name clone) (/.git/hooks/post-merge)}
            )
          ]
        )
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'post-merge does not run for up-to-date ' span_id:95))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:99) 
          (Token
            id: Id.Lit_Chars
            val: '        GIT_DIR=clone1/.git git merge $commit0 &&\n'
            span_id: 100
          ) (Token id:Id.Lit_Chars val:'\t! test -f clone1/.git/post-merge.args\n' span_id:101)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'post-merge runs as expected ' span_id:108))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:112) 
          (Token
            id: Id.Lit_Chars
            val: '        GIT_DIR=clone1/.git git merge $commit1 &&\n'
            span_id: 113
          ) (Token id:Id.Lit_Chars val:'\ttest -e clone1/.git/post-merge.args\n' span_id:114)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'post-merge from normal merge receives the right argument '
            span_id: 121
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:125) 
          (Token
            id: Id.Lit_Chars
            val: '        grep 0 clone1/.git/post-merge.args\n'
            span_id: 126
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'post-merge from squash merge runs as expected ' span_id:133))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:137) 
          (Token
            id: Id.Lit_Chars
            val: '        GIT_DIR=clone2/.git git merge --squash $commit1 &&\n'
            span_id: 138
          ) (Token id:Id.Lit_Chars val:'\ttest -e clone2/.git/post-merge.args\n' span_id:139)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'post-merge from squash merge receives the right argument '
            span_id: 146
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:150) 
          (Token
            id: Id.Lit_Chars
            val: '        grep 1 clone2/.git/post-merge.args\n'
            span_id: 151
          )
        )
      }
    )
    (C {(test_done)})
  ]
)