(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'refspec parsing'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShFunction
      name: test_refspec
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:kind)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [23]
                )
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:refspec)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [26]
                )
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expect)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [29]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<git>} {<config>} {<remote.frotz.url>} {(DQ <.>)})
                (C {<git>} {<config>} {<--remove-section>} {<remote.frotz>})
                (C {<git>} {<config>} {<remote.frotz.url>} {(DQ <.>)})
                (C {<git>} {<config>} {(DQ <remote.frotz.> ($ Id.VSub_DollarName '$kind'))} 
                  {(DQ ($ Id.VSub_DollarName '$refspec'))}
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$expect'))} 
                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<invalid>}
                        )
                      ]
                      action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:title)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ ($ Id.VSub_DollarName '$kind') <' '> 
                                    ($ Id.VSub_DollarName '$refspec')
                                  )
                                }
                              spids: [103]
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:test)
                              op: assign_op.Equal
                              rhs: {(SQ <'git ls-remote frotz'>)}
                              spids: [111]
                            )
                          ]
                        )
                      ]
                      spids: [86 100]
                    )
                  ]
                  else_action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:title)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$kind') <' '> 
                                ($ Id.VSub_DollarName '$refspec') <' (invalid)'>
                              )
                            }
                          spids: [120]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:test)
                          op: assign_op.Equal
                          rhs: {(SQ <'test_must_fail git ls-remote frotz'>)}
                          spids: [129]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$title'))} 
              {(DQ ($ Id.VSub_DollarName '$test'))}
            )
          ]
        )
    )
    (C {<test_refspec>} {<push>} {(SQ )} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <':'>)})
    (C {<test_refspec>} {<push>} {(SQ <'::'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'+:'>)})
    (C {<test_refspec>} {<fetch>} {(SQ )})
    (C {<test_refspec>} {<fetch>} {(SQ <':'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'::'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*:refs/remotes/frotz/*'>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*:refs/remotes/frotz'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads:refs/remotes/frotz/*'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/master:refs/remotes/frotz/xyzzy'>)})
    (C {<Id.Lit_Colon ':'>} {<test_refspec>} {<push>} 
      {(SQ <'refs/heads/master::refs/remotes/frotz/xyzzy'>)} {<invalid>}
    )
    (C {<Id.Lit_Colon ':'>} {<test_refspec>} {<push>} 
      {(SQ <'refs/heads/maste :refs/remotes/frotz/xyzzy'>)} {<invalid>}
    )
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*:refs/remotes/frotz/*'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*:refs/remotes/frotz'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads:refs/remotes/frotz/*'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/master:refs/remotes/frotz/xyzzy'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/master::refs/remotes/frotz/xyzzy'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/maste :refs/remotes/frotz/xyzzy'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'master~1:refs/remotes/frotz/backup'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'master~1:refs/remotes/frotz/backup'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'HEAD~4:refs/remotes/frotz/new'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'HEAD~4:refs/remotes/frotz/new'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <HEAD>)})
    (C {<test_refspec>} {<fetch>} {(SQ <HEAD>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/ nitfol'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/ nitfol'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'HEAD:'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'HEAD:'>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/ nitfol:'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/ nitfol:'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <':refs/remotes/frotz/deleteme'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <':refs/remotes/frotz/HEAD-to-me'>)})
    (C {<test_refspec>} {<push>} {(SQ <':refs/remotes/frotz/delete me'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <':refs/remotes/frotz/HEAD to me'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*/for-linus:refs/remotes/mine/*-blah'>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*/for-linus:refs/remotes/mine/*-blah'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads*/for-linus:refs/remotes/mine/*'>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads*/for-linus:refs/remotes/mine/*'>)})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*/*/for-linus:refs/remotes/mine/*'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*/*/for-linus:refs/remotes/mine/*'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*g*/for-linus:refs/remotes/mine/*'>)} {<invalid>})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*g*/for-linus:refs/remotes/mine/*'>)} {<invalid>})
    (C {<test_refspec>} {<fetch>} {(SQ <'refs/heads/*/for-linus:refs/remotes/mine/*'>)})
    (C {<test_refspec>} {<push>} {(SQ <'refs/heads/*/for-linus:refs/remotes/mine/*'>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:good)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\303\\204'>)})
              )
            }
          spids: [589]
        )
      ]
    )
    (C {<test_refspec>} {<fetch>} {(DQ <'refs/heads/'> (${ Id.VSub_Name good))})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bad)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\011tab'>)})
              )
            }
          spids: [609]
        )
      ]
    )
    (C {<test_refspec>} {<fetch>} {(DQ <'refs/heads/'> (${ Id.VSub_Name bad))} {<invalid>})
    (C {<test_done>})
  ]
)