(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'Revision traversal vs grafts and path limiter'>)}
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <'\n'> <'\tmkdir subdir &&\n'> <'\techo >fileA fileA &&\n'> 
          <'\techo >subdir/fileB fileB &&\n'> <'\tgit add fileA subdir/fileB &&\n'> <'\tgit commit -a -m "Initial in one history." &&\n'> 
          <'\tA0=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >fileA fileA modified &&\n'> <'\tgit commit -a -m "Second in one history." &&\n'> 
          <'\tA1=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >subdir/fileB fileB modified &&\n'> <'\tgit commit -a -m "Third in one history." &&\n'> 
          <'\tA2=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\trm -f .git/refs/heads/master .git/index &&\n'> <'\n'> <'\techo >fileA fileA again &&\n'> 
          <'\techo >subdir/fileB fileB again &&\n'> <'\tgit add fileA subdir/fileB &&\n'> <'\tgit commit -a -m "Initial in alternate history." &&\n'> 
          <'\tB0=$(git rev-parse --verify HEAD) &&\n'> <'\n'> <'\techo >fileA fileA modified in alternate history &&\n'> 
          <'\tgit commit -a -m "Second in alternate history." &&\n'> <'\tB1=$(git rev-parse --verify HEAD) &&\n'> <'\n'> 
          <'\techo >subdir/fileB fileB modified in alternate history &&\n'> <'\tgit commit -a -m "Third in alternate history." &&\n'> <'\tB2=$(git rev-parse --verify HEAD) &&\n'> 
          <'\t: done\n'>
        )
      }
    )
    (command.FuncDef
      name: check
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:type)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                )
              ]
            )
            (C {(shift)})
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:arg) op:Equal rhs:(word.EmptyWord))]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:which) op:Equal rhs:{(arg)})]
            )
            (C {(rm)} {(-f)} {(test.expect)})
            (command.ForEach
              iter_name: a
              do_arg_iter: T
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(test)} {(DQ (z) ($ VSub_DollarName '$a'))} {(Lit_Other '=')} {(z--)})
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:which)
                                  op: Equal
                                  rhs: {(expect)}
                                )
                              ]
                            )
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:child) op:Equal rhs:(word.EmptyWord))]
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Continue continue>
                            )
                          ]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(test)} {(DQ ($ VSub_DollarName '$which'))} {(Lit_Other '=')} {(arg)})
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:arg)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_DollarName '$arg') ($ VSub_DollarName '$a') (' '))}
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Continue continue>
                            )
                          ]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(test)} {(DQ ($ VSub_DollarName '$type'))} {(Lit_Other '=')} {(basic)})
                          ]
                          action: [(C {(echo)} {(DQ ($ VSub_DollarName '$a'))})]
                        )
                      ]
                      else_action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (C {(test)} {(DQ (z) ($ VSub_DollarName '$child'))} 
                                  {(KW_Bang '!') (Lit_Other '=')} {(z)}
                                )
                              ]
                              action: [
                                (C {(echo)} 
                                  {(DQ ($ VSub_DollarName '$child') (' ') ($ VSub_DollarName '$a'))}
                                )
                              ]
                            )
                          ]
                        )
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:child)
                              op: Equal
                              rhs: {(DQ ($ VSub_DollarName '$a'))}
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
              redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(test.expect)})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(test)} {(DQ ($ VSub_DollarName '$type'))} {(KW_Bang '!') (Lit_Other '=')} 
                          {(basic)}
                        )
                        (C {(test)} {(DQ (z) ($ VSub_DollarName '$child'))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(z)}
                        )
                      ]
                    )
                  ]
                  action: [
                    (command.SimpleCommand
                      words: [{(echo)} {($ VSub_DollarName '$child')}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_DGreat '>>'>
                          fd: 16777215
                          arg_word: {(test.expect)}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {($ VSub_DollarName '$type')} {(Lit_Other '=')} {(basic)})]
                  action: [
                    (command.SimpleCommand
                      words: [{(git)} {(rev-list)} {($ VSub_DollarName '$arg')}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(test.actual)}
                        )
                      ]
                    )
                  ]
                )
                (if_arm
                  cond: [(C {(test)} {($ VSub_DollarName '$type')} {(Lit_Other '=')} {(parents)})]
                  action: [
                    (command.SimpleCommand
                      words: [{(git)} {(rev-list)} {(--parents)} {($ VSub_DollarName '$arg')}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(test.actual)}
                        )
                      ]
                    )
                  ]
                )
                (if_arm
                  cond: [(C {(test)} {($ VSub_DollarName '$type')} {(Lit_Other '=')} {(parents-raw)})]
                  action: [
                    (command.Pipeline
                      children: [
                        (C {(git)} {(rev-list)} {(--parents)} {(--pretty) (Lit_Other '=') (raw)} 
                          {($ VSub_DollarName '$arg')}
                        )
                        (command.SimpleCommand
                          words: [{(sed)} {(-n)} {(-e)} {(SQ <'s/^commit //p'>)}]
                          redirects: [
                            (redir.Redir
                              op: <Redir_Great '>'>
                              fd: 16777215
                              arg_word: {(test.actual)}
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                )
              ]
            )
            (C {(test_cmp)} {(test.expect)} {(test.actual)})
          ]
        )
    )
    (command.ForEach
      iter_name: type
      iter_words: [{(basic)} {(parents)} {(parents-raw)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {(test_expect_success)} {(SQ <'without grafts'>)} 
              {
                (DQ ('\n') ('\t\trm -f .git/info/grafts &&\n') ('\t\tcheck ') 
                  ($ VSub_DollarName '$type') (' ') ($ VSub_DollarName '$B2') (' -- ') ($ VSub_DollarName '$B2') (' ') ($ VSub_DollarName '$B1') (' ') 
                  ($ VSub_DollarName '$B0') ('\n') ('\t')
                )
              }
            )
            (C {(test_expect_success)} {(SQ <'with grafts'>)} 
              {
                (DQ ('\n') ("\t\techo '") ($ VSub_DollarName '$B0') (' ') ($ VSub_DollarName '$A2') 
                  ("' >.git/info/grafts &&\n") ('\t\tcheck ') ($ VSub_DollarName '$type') (' ') ($ VSub_DollarName '$B2') (' -- ') 
                  ($ VSub_DollarName '$B2') (' ') ($ VSub_DollarName '$B1') (' ') ($ VSub_DollarName '$B0') (' ') ($ VSub_DollarName '$A2') (' ') 
                  ($ VSub_DollarName '$A1') (' ') ($ VSub_DollarName '$A0') ('\n') ('\t')
                )
              }
            )
            (C {(test_expect_success)} {(SQ <'without grafts, with pathlimit'>)} 
              {
                (DQ ('\n') ('\t\trm -f .git/info/grafts &&\n') ('\t\tcheck ') 
                  ($ VSub_DollarName '$type') (' ') ($ VSub_DollarName '$B2') (' subdir -- ') ($ VSub_DollarName '$B2') (' ') ($ VSub_DollarName '$B0') 
                  ('\n') ('\t')
                )
              }
            )
            (C {(test_expect_success)} {(SQ <'with grafts, with pathlimit'>)} 
              {
                (DQ ('\n') ("\t\techo '") ($ VSub_DollarName '$B0') (' ') ($ VSub_DollarName '$A2') 
                  ("' >.git/info/grafts &&\n") ('\t\tcheck ') ($ VSub_DollarName '$type') (' ') ($ VSub_DollarName '$B2') (' subdir -- ') 
                  ($ VSub_DollarName '$B2') (' ') ($ VSub_DollarName '$B0') (' ') ($ VSub_DollarName '$A2') (' ') ($ VSub_DollarName '$A0') ('\n') 
                  ('\t')
                )
              }
            )
          ]
        )
    )
    (C {(test_done)})
  ]
)