(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 <'undoing resolution'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <check_resolve_undo>
      name: check_resolve_undo
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'msg='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'msg='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'msg='> name:msg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <shift>
              more_env: []
              words: [{<shift>}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Case
                          case_kw: <Id.KW_Case case>
                          to_match: (case_arg.Word w:{($ Id.VSub_Pound '#')})
                          arms_start: <Id.KW_In in>
                          arms: [
                            (CaseArm
                              left: <0>
                              pattern: (pat.Words words:[{<0>}])
                              middle: <Id.Right_CasePat _>
                              action: [(command.ControlFlow keyword:<Id.ControlFlow_Break break>)]
                              right: <Id.Op_DSemi _>
                            )
                            (CaseArm
                              left: <1>
                              pattern: (pat.Words words:[{<1>} {<2>} {<3>}])
                              middle: <Id.Right_CasePat _>
                              action: [
                                (command.Simple
                                  blame_tok: <die>
                                  more_env: []
                                  words: [{<die>} {(DQ <'Bug in check-resolve-undo test'>)}]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                              right: <Id.Op_DSemi _>
                            )
                          ]
                          arms_end: <Id.KW_Esac esac>
                          redirects: []
                        )
                      ]
                    )
                  body: 
                    (command.DoGroup
                      left: <Id.KW_Do do>
                      children: [
                        (command.ShAssignment
                          left: <Id.Lit_VarLike 'path='>
                          pairs: [
                            (AssignPair
                              left: <Id.Lit_VarLike 'path='>
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'path='> name:path)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number 1)}
                            )
                          ]
                          redirects: []
                        )
                        (command.Simple
                          blame_tok: <shift>
                          more_env: []
                          words: [{<shift>}]
                          redirects: []
                          do_fork: T
                        )
                        (command.ForEach
                          keyword: <Id.KW_For for>
                          iter_names: [stage]
                          iterable: (for_iter.Words words:[{<1>} {<2>} {<3>}])
                          body: 
                            (command.DoGroup
                              left: <Id.KW_Do do>
                              children: [
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'sha1='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'sha1='>
                                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sha1='> name:sha1)
                                      op: assign_op.Equal
                                      rhs: {($ Id.VSub_Number 1)}
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.Simple
                                  blame_tok: <shift>
                                  more_env: []
                                  words: [{<shift>}]
                                  redirects: []
                                  do_fork: T
                                )
                                (command.Case
                                  case_kw: <Id.KW_Case case>
                                  to_match: (case_arg.Word w:{(DQ ($ Id.VSub_DollarName sha1))})
                                  arms_start: <Id.KW_In in>
                                  arms: [
                                    (CaseArm
                                      left: <Id.Left_SingleQuote '\''>
                                      pattern: (pat.Words words:[{(SQ )}])
                                      middle: <Id.Right_CasePat _>
                                      action: [
                                        (command.ControlFlow
                                          keyword: <Id.ControlFlow_Continue continue>
                                        )
                                      ]
                                      right: <Id.Op_DSemi _>
                                    )
                                  ]
                                  arms_end: <Id.KW_Esac esac>
                                  redirects: []
                                )
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'sha1='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'sha1='>
                                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sha1='> name:sha1)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (CommandSub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: 
                                              (command.Simple
                                                blame_tok: <git>
                                                more_env: []
                                                words: [
                                                  {<git>}
                                                  {<rev-parse>}
                                                  {<--verify>}
                                                  {(DQ ($ Id.VSub_DollarName sha1))}
                                                ]
                                                redirects: []
                                                do_fork: T
                                              )
                                            right: <Id.Eof_RParen _>
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.Simple
                                  blame_tok: <printf>
                                  more_env: []
                                  words: [
                                    {<printf>}
                                    {
                                      (DQ <'100644 %s %s'> <Id.Lit_BadBackslash '\\'> <'t%s'> 
                                        <Id.Lit_BadBackslash '\\'> <n>
                                      )
                                    }
                                    {($ Id.VSub_DollarName sha1)}
                                    {($ Id.VSub_DollarName stage)}
                                    {($ Id.VSub_DollarName path)}
                                  ]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                              right: <Id.KW_Done done>
                            )
                          redirects: []
                        )
                      ]
                      right: <Id.KW_Done done>
                    )
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName msg) <.expect>)}
                    )
                  ]
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<ls-files>} {<--resolve-undo>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName msg) <.actual>)}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ ($ Id.VSub_DollarName msg) <.expect>)}
                    {(DQ ($ Id.VSub_DollarName msg) <.actual>)}
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <prime_resolve_undo>
      name: prime_resolve_undo
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<reset>} {<--hard>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<checkout>} {<second> <Id.Lit_Other '^'> <0>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_tick>
                  more_env: []
                  words: [{<test_tick>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_must_fail>
                  more_env: []
                  words: [{<test_must_fail>} {<git>} {<merge>} {<third> <Id.Lit_Other '^'> <0>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {<merge>} {<does>} {<not>} {<leave>} {<anything>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <check_resolve_undo>
                  more_env: []
                  words: [{<check_resolve_undo>} {<empty>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {<different>}]
                  redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'fi/le'>})]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<add>} {<'fi/le'>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {<resolving>} {<records>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <check_resolve_undo>
                  more_env: []
                  words: [
                    {<check_resolve_undo>}
                    {<recorded>}
                    {<'fi/le'>}
                    {<initial> <Id.Lit_Colon ':'> <'fi/le'>}
                    {<second> <Id.Lit_Colon ':'> <'fi/le'>}
                    {<third> <Id.Lit_Colon ':'> <'fi/le'>}
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
                <Id.Op_DAmp _>
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\tmkdir fi &&\n'> <'\tprintf "a\\0a" >binary &&\n'> <'\tgit add binary &&\n'> 
            <'\ttest_commit initial fi/le first &&\n'> <'\tgit branch side &&\n'> <'\tgit branch another &&\n'> <'\tprintf "a\\0b" >binary &&\n'> 
            <'\tgit add binary &&\n'> <'\ttest_commit second fi/le second &&\n'> <'\tgit checkout side &&\n'> 
            <'\ttest_commit third fi/le third &&\n'> <'\tgit branch add-add &&\n'> <'\tgit checkout another &&\n'> 
            <'\ttest_commit fourth fi/le fourth &&\n'> <'\tgit checkout add-add &&\n'> <'\ttest_commit fifth add-differently &&\n'> 
            <'\tgit checkout master\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'add records switch clears'>)}
        {
          (SQ <'\n'> <'\tprime_resolve_undo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m merged &&\n'> 
            <'\techo committing keeps &&\n'> <'\tcheck_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&\n'> 
            <'\tgit checkout second^0 &&\n'> <'\techo switching clears &&\n'> <'\tcheck_resolve_undo cleared\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rm records reset clears'>)}
        {
          (SQ <'\n'> <'\tprime_resolve_undo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m merged &&\n'> 
            <'\techo committing keeps &&\n'> <'\tcheck_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&\n'> <'\n'> 
            <'\techo merge clears upfront &&\n'> <'\ttest_must_fail git merge fourth^0 &&\n'> <'\tcheck_resolve_undo nuked &&\n'> <'\n'> 
            <'\tgit rm -f fi/le &&\n'> <'\techo resolving records &&\n'> 
            <'\tcheck_resolve_undo recorded fi/le initial:fi/le HEAD:fi/le fourth:fi/le &&\n'> <'\n'> <'\tgit reset --hard &&\n'> <'\techo resetting discards &&\n'> 
            <'\tcheck_resolve_undo discarded\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'plumbing clears'>)}
        {
          (SQ <'\n'> <'\tprime_resolve_undo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m merged &&\n'> 
            <'\techo committing keeps &&\n'> <'\tcheck_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&\n'> <'\n'> 
            <'\techo plumbing clear &&\n'> <'\tgit update-index --clear-resolve-undo &&\n'> <'\tcheck_resolve_undo cleared\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'add records checkout -m undoes'>)}
        {
          (SQ <'\n'> <'\tprime_resolve_undo &&\n'> <'\tgit diff HEAD &&\n'> 
            <'\tgit checkout --conflict=merge fi/le &&\n'> <'\techo checkout used the record and removed it &&\n'> <'\tcheck_resolve_undo removed &&\n'> 
            <'\techo the index and the work tree is unmerged again &&\n'> <'\tgit diff >actual &&\n'> <'\tgrep "^++<<<<<<<" actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'unmerge with plumbing'>)}
        {
          (SQ <'\n'> <'\tprime_resolve_undo &&\n'> <'\tgit update-index --unresolve fi/le &&\n'> 
            <'\tgit ls-files -u >actual &&\n'> <'\ttest_line_count = 3 actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rerere and rerere forget'>)}
        {
          (SQ <'\n'> <'\tmkdir .git/rr-cache &&\n'> <'\tprime_resolve_undo &&\n'> 
            <'\techo record the resolution &&\n'> <'\tgit rerere &&\n'> <'\trerere_id=$(cd .git/rr-cache && echo */postimage) &&\n'> 
            <'\trerere_id=${rerere_id%/postimage} &&\n'> <'\ttest -f .git/rr-cache/$rerere_id/postimage &&\n'> <'\tgit checkout -m fi/le &&\n'> 
            <'\techo resurrect the conflict &&\n'> <'\tgrep "^=======" fi/le &&\n'> <'\techo reresolve the conflict &&\n'> <'\tgit rerere &&\n'> 
            <'\ttest "z$(cat fi/le)" = zdifferent &&\n'> <'\techo register the resolution again &&\n'> <'\tgit add fi/le &&\n'> 
            <'\tcheck_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&\n'> <'\ttest -z "$(git ls-files -u)" &&\n'> <'\tgit rerere forget fi/le &&\n'> 
            <'\t! test -f .git/rr-cache/$rerere_id/postimage &&\n'> <'\ttr "\\0" "\\n" <.git/MERGE_RR >actual &&\n'> <'\techo "$rerere_id\tfi/le" >expect &&\n'> 
            <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rerere and rerere forget (subdirectory)'>)}
        {
          (SQ <'\n'> <'\trm -fr .git/rr-cache &&\n'> <'\tmkdir .git/rr-cache &&\n'> 
            <'\tprime_resolve_undo &&\n'> <'\techo record the resolution &&\n'> <'\t(cd fi && git rerere) &&\n'> 
            <'\trerere_id=$(cd .git/rr-cache && echo */postimage) &&\n'> <'\trerere_id=${rerere_id%/postimage} &&\n'> <'\ttest -f .git/rr-cache/$rerere_id/postimage &&\n'> 
            <'\t(cd fi && git checkout -m le) &&\n'> <'\techo resurrect the conflict &&\n'> <'\tgrep "^=======" fi/le &&\n'> 
            <'\techo reresolve the conflict &&\n'> <'\t(cd fi && git rerere) &&\n'> <'\ttest "z$(cat fi/le)" = zdifferent &&\n'> 
            <'\techo register the resolution again &&\n'> <'\t(cd fi && git add le) &&\n'> 
            <'\tcheck_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&\n'> <'\ttest -z "$(git ls-files -u)" &&\n'> <'\t(cd fi && git rerere forget le) &&\n'> 
            <'\t! test -f .git/rr-cache/$rerere_id/postimage &&\n'> <'\ttr "\\0" "\\n" <.git/MERGE_RR >actual &&\n'> <'\techo "$rerere_id\tfi/le" >expect &&\n'> 
            <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rerere forget (binary)'>)}
        {
          (SQ <'\n'> <'\tgit checkout -f side &&\n'> <'\tprintf "a\\0c" >binary &&\n'> 
            <'\tgit commit -a -m binary &&\n'> <'\ttest_must_fail git merge second &&\n'> <'\tgit rerere forget binary\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rerere forget (add-add conflict)'>)}
        {
          (SQ <'\n'> <'\tgit checkout -f master &&\n'> <'\techo master >add-differently &&\n'> 
            <'\tgit add add-differently &&\n'> <'\tgit commit -m "add differently" &&\n'> <'\ttest_must_fail git merge fifth &&\n'> 
            <'\tgit rerere forget add-differently 2>actual &&\n'> <'\ttest_i18ngrep "no remembered" actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)