(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: 
            {
              (SQ <'git merge\n'> <'\n'> 
                <'Testing merge when using a custom message for the merge commit.'>
              )
            }
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShFunction
      name: create_merge_msgs
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<echo>} {(DQ <'custom message'>)}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<exp.subject>})]
              do_fork: T
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<cp>} {<exp.subject>} {<exp.log>})
                (command.Simple
                  words: [{<echo>} {(DQ )}]
                  redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<exp.log>})]
                  do_fork: T
                )
                (command.Simple
                  words: [{<echo>} {(DQ <'* tag \'c2\':'>)}]
                  redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<exp.log>})]
                  do_fork: T
                )
                (command.Simple
                  words: [{<echo>} {(DQ <'  c2'>)}]
                  redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<exp.log>})]
                  do_fork: T
                )
              ]
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\techo c0 > c0.c &&\n'> <'\tgit add c0.c &&\n'> <'\tgit commit -m c0 &&\n'> 
          <'\tgit tag c0 &&\n'> <'\techo c1 > c1.c &&\n'> <'\tgit add c1.c &&\n'> <'\tgit commit -m c1 &&\n'> <'\tgit tag c1 &&\n'> 
          <'\tgit reset --hard c0 &&\n'> <'\techo c2 > c2.c &&\n'> <'\tgit add c2.c &&\n'> <'\tgit commit -m c2 &&\n'> <'\tgit tag c2 &&\n'> 
          <'\tcreate_merge_msgs\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'merge c2 with a custom message'>)} 
      {
        (SQ <'\n'> <'\tgit reset --hard c1 &&\n'> <'\tgit merge -m "$(cat exp.subject)" c2 &&\n'> 
          <'\tgit cat-file commit HEAD | sed -e "1,/^$/d" >actual &&\n'> <'\ttest_cmp exp.subject actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'merge --log appends to custom message'>)} 
      {
        (SQ <'\n'> <'\tgit reset --hard c1 &&\n'> <'\tgit merge --log -m "$(cat exp.subject)" c2 &&\n'> 
          <'\tgit cat-file commit HEAD | sed -e "1,/^$/d" >actual &&\n'> <'\ttest_cmp exp.log actual\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)