(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[21])
          op: Equal
          rhs: {(SQ <'Tests to check that "reset" options follow a known table'>)}
          spids: [21]
        )
      ]
      spids: [21]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ <'creating initial commits'>)} 
      {
        (SQ <'\n'> <'    test_commit E file1 &&\n'> <'    test_commit D file1 &&\n'> 
          <'    test_commit C file1\n'>
        )
      }
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [(C {(read)} {(W1)} {(I1)} {(H1)} {(T)} {(opt)} {(W2)} {(I2)} {(H2)})]
      body: 
        (command.DoGroup
          children: [
            (C {(test_expect_success)} 
              {
                (DQ ('check: ') ($ VSub_Name '$W1') (' ') ($ VSub_Name '$I1') (' ') ($ VSub_Name '$H1') 
                  (' ') ($ VSub_Name '$T') (' --') ($ VSub_Name '$opt') (' ') ($ VSub_Name '$W2') (' ') ($ VSub_Name '$I2') (' ') 
                  ($ VSub_Name '$H2')
                )
              } 
              {
                (SQ <'\n'> <'\tgit reset --hard C &&\n'> <'\tif test "$I1" != "$H1"\n'> <'\tthen\n'> 
                  <'\t    echo "$I1" >file1 &&\n'> <'\t    git add file1\n'> <'\tfi &&\n'> <'\tif test "$W1" != "$I1"\n'> <'\tthen\n'> 
                  <'\t    echo "$W1" >file1\n'> <'\tfi &&\n'> <'\tif test "$W2" != "XXXXX"\n'> <'\tthen\n'> <'\t    git reset --$opt $T &&\n'> 
                  <'\t    test "$(cat file1)" = "$W2" &&\n'> <'\t    git checkout-index -f -- file1 &&\n'> <'\t    test "$(cat file1)" = "$I2" &&\n'> 
                  <'\t    git checkout -f HEAD -- file1 &&\n'> <'\t    test "$(cat file1)" = "$H2"\n'> <'\telse\n'> <'\t    test_must_fail git reset --$opt $T\n'> 
                  <'\tfi\n'> <'    '>
                )
              }
            )
          ]
          spids: [67 117]
        )
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 153
          stdin_parts: [
            ('A B C D soft   A B D\n')
            ('A B C D mixed  A D D\n')
            ('A B C D hard   D D D\n')
            ('A B C D merge  XXXXX\n')
            ('A B C D keep   XXXXX\n')
            ('A B C C soft   A B C\n')
            ('A B C C mixed  A C C\n')
            ('A B C C hard   C C C\n')
            ('A B C C merge  XXXXX\n')
            ('A B C C keep   A C C\n')
            ('B B C D soft   B B D\n')
            ('B B C D mixed  B D D\n')
            ('B B C D hard   D D D\n')
            ('B B C D merge  D D D\n')
            ('B B C D keep   XXXXX\n')
            ('B B C C soft   B B C\n')
            ('B B C C mixed  B C C\n')
            ('B B C C hard   C C C\n')
            ('B B C C merge  C C C\n')
            ('B B C C keep   B C C\n')
            ('B C C D soft   B C D\n')
            ('B C C D mixed  B D D\n')
            ('B C C D hard   D D D\n')
            ('B C C D merge  XXXXX\n')
            ('B C C D keep   XXXXX\n')
            ('B C C C soft   B C C\n')
            ('B C C C mixed  B C C\n')
            ('B C C C hard   C C C\n')
            ('B C C C merge  B C C\n')
            ('B C C C keep   B C C\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'setting up branches to test with unmerged entries'>)} 
      {
        (SQ <'\n'> <'    git reset --hard C &&\n'> <'    git branch branch1 &&\n'> 
          <'    git branch branch2 &&\n'> <'    git checkout branch1 &&\n'> <'    test_commit B1 file1 &&\n'> <'    git checkout branch2 &&\n'> 
          <'    test_commit B file1\n'>
        )
      }
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [(C {(read)} {(W1)} {(I1)} {(H1)} {(T)} {(opt)} {(W2)} {(I2)} {(H2)})]
      body: 
        (command.DoGroup
          children: [
            (C {(test_expect_success)} 
              {
                (DQ ('check: ') ($ VSub_Name '$W1') (' ') ($ VSub_Name '$I1') (' ') ($ VSub_Name '$H1') 
                  (' ') ($ VSub_Name '$T') (' --') ($ VSub_Name '$opt') (' ') ($ VSub_Name '$W2') (' ') ($ VSub_Name '$I2') (' ') 
                  ($ VSub_Name '$H2')
                )
              } 
              {
                (SQ <'\n'> <'\tgit reset --hard B &&\n'> <'\ttest_must_fail git merge branch1 &&\n'> 
                  <'\tcat file1 >X_file1 &&\n'> <'\tif test "$W2" != "XXXXX"\n'> <'\tthen\n'> <'\t    git reset --$opt $T &&\n'> 
                  <'\t    if test "$W2" = "X"\n'> <'\t    then\n'> <'\t\ttest_cmp file1 X_file1\n'> <'\t    else\n'> <'\t\ttest "$(cat file1)" = "$W2"\n'> 
                  <'\t    fi &&\n'> <'\t    git checkout-index -f -- file1 &&\n'> <'\t    test "$(cat file1)" = "$I2" &&\n'> 
                  <'\t    git checkout -f HEAD -- file1 &&\n'> <'\t    test "$(cat file1)" = "$H2"\n'> <'\telse\n'> <'\t    test_must_fail git reset --$opt $T\n'> 
                  <'\tfi\n'> <'    '>
                )
              }
            )
          ]
          spids: [193 241]
        )
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 257
          stdin_parts: [
            ('X U B C soft   XXXXX\n')
            ('X U B C mixed  X C C\n')
            ('X U B C hard   C C C\n')
            ('X U B C merge  C C C\n')
            ('X U B C keep   XXXXX\n')
            ('X U B B soft   XXXXX\n')
            ('X U B B mixed  X B B\n')
            ('X U B B hard   B B B\n')
            ('X U B B merge  B B B\n')
            ('X U B B keep   XXXXX\n')
          ]
        )
      ]
    )
    (C {(test_done)})
  ]
)