(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <cd_to_toplevel>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:EXEC_PATH)
          op: assign_op.Equal
          rhs: 
            {(DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<git>} {<--exec-path>})))}
          spids: [15]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test_have_prereq>} {<Id.KW_Bang '!'> <MINGW>})
        (command.Case
          to_match: {(DQ ($ Id.VSub_DollarName '$EXEC_PATH'))}
          arms: [
            (case_arm
              pat_list: [
                {<Id.Lit_LBracket '['> <A-Za-z> <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'> <'/'> 
                  <Id.Lit_Star '*'>
                }
              ]
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:EXEC_PATH)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ <'/'> 
                            (braced_var_sub
                              token: <Id.VSub_Name EXEC_PATH>
                              suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{<':*'>})
                            ) 
                            (braced_var_sub
                              token: <Id.VSub_Name EXEC_PATH>
                              suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{<'?:'>})
                            )
                          )
                        }
                      spids: [48]
                    )
                  ]
                )
              ]
              spids: [39 45 64 -1]
            )
          ]
        )
      ]
    )
    (command.ShFunction
      name: test_cd_to_toplevel
      body: 
        (BraceGroup
          children: [
            (C {<test_expect_success>} {($ Id.VSub_Number '$3')} {(DQ ($ Id.VSub_Number '$2'))} 
              {(SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd '>) (DQ <'\''> ($ Id.VSub_Number '$1') <'\''>) 
                (SQ <' &&\n'> <'\t\t\tPATH="$EXEC_PATH:$PATH" &&\n'> <'\t\t\t. git-sh-setup &&\n'> 
                  <'\t\t\tcd_to_toplevel &&\n'> <'\t\t\t[ "$(pwd -P)" = "$TOPLEVEL" ]\n'> <'\t\t)\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TOPLEVEL)
          op: assign_op.Equal
          rhs: 
            {
              (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>} {<-P>})) 
                <'/repo'>
              )
            }
          spids: [108]
        )
      ]
    )
    (C {<mkdir>} {<-p>} {<'repo/sub/dir'>})
    (C {<mv>} {<.git>} {<'repo/'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUBDIRECTORY_OK)
          op: assign_op.Equal
          rhs: {<1>}
          spids: [130]
        )
      ]
    )
    (C {<test_cd_to_toplevel>} {<repo>} {(SQ <'at physical root'>)})
    (C {<test_cd_to_toplevel>} {<'repo/sub/dir'>} {(SQ <'at physical subdir'>)})
    (command.Simple
      words: [{<ln>} {<-s>} {<repo>} {<symrepo>}]
      redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
      do_fork: T
    )
    (C {<test_cd_to_toplevel>} {<symrepo>} {(SQ <'at symbolic root'>)} {<SYMLINKS>})
    (command.Simple
      words: [{<ln>} {<-s>} {<'repo/sub/dir'>} {<subdir-link>}]
      redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
      do_fork: T
    )
    (C {<test_cd_to_toplevel>} {<subdir-link>} {(SQ <'at symbolic subdir'>)} {<SYMLINKS>})
    (C {<cd>} {<repo>})
    (command.Simple
      words: [{<ln>} {<-s>} {<'sub/dir'>} {<internal-link>}]
      redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
      do_fork: T
    )
    (C {<test_cd_to_toplevel>} {<internal-link>} {(SQ <'at internal symbolic subdir'>)} {<SYMLINKS>})
    (C {<test_done>})
  ]
)