(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test <branch>@{push} syntax'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShFunction
      name: resolve
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{<echo>} {(DQ ($ Id.VSub_Number '$2'))}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})]
                  do_fork: T
                )
                (command.Simple
                  words: [{<git>} {<rev-parse>} {<--symbolic-full-name>} {(DQ ($ Id.VSub_Number '$1'))}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<actual>})]
                  do_fork: T
                )
                (C {<test_cmp>} {<expect>} {<actual>})
              ]
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\tgit init --bare parent.git &&\n'> <'\tgit init --bare other.git &&\n'> 
          <'\tgit remote add origin parent.git &&\n'> <'\tgit remote add other other.git &&\n'> <'\ttest_commit base &&\n'> <'\tgit push origin HEAD &&\n'> 
          <'\tgit branch --set-upstream-to=origin/master master &&\n'> <'\tgit branch --track topic origin/master &&\n'> <'\tgit push origin topic &&\n'> 
          <'\tgit push other topic\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with default=nothing'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default nothing &&\n'> 
          <'\ttest_must_fail git rev-parse master@{push}\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with default=simple'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default simple &&\n'> 
          <'\tresolve master@{push} refs/remotes/origin/master\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'triangular @{push} fails with default=simple'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default simple &&\n'> 
          <'\ttest_must_fail git rev-parse topic@{push}\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with default=current'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default current &&\n'> 
          <'\tresolve topic@{push} refs/remotes/origin/topic\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with default=matching'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default matching &&\n'> 
          <'\tresolve topic@{push} refs/remotes/origin/topic\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with pushremote defined'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default current &&\n'> 
          <'\ttest_config branch.topic.pushremote other &&\n'> <'\tresolve topic@{push} refs/remotes/other/topic\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'@{push} with push refspecs'>)} 
      {
        (SQ <'\n'> <'\ttest_config push.default nothing &&\n'> 
          <'\ttest_config remote.origin.push refs/heads/*:refs/heads/magic/* &&\n'> <'\tgit push &&\n'> <'\tresolve topic@{push} refs/remotes/origin/magic/topic\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)