(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test <branch>@{upstream} syntax'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <setup>)}
        {
          (SQ <'\n'> <'\n'> <'\ttest_commit 1 &&\n'> <'\tgit checkout -b side &&\n'> 
            <'\ttest_commit 2 &&\n'> <'\tgit checkout master &&\n'> <'\tgit clone . clone &&\n'> <'\ttest_commit 3 &&\n'> 
            <'\t(cd clone &&\n'> <'\t test_commit 4 &&\n'> <'\t git branch --track my-side origin/side &&\n'> 
            <'\t git branch --track local-master master &&\n'> <'\t git branch --track fun@ny origin/side &&\n'> <'\t git branch --track @funny origin/side &&\n'> 
            <'\t git branch --track funny@ origin/side &&\n'> <'\t git remote add -t master master-only .. &&\n'> <'\t git fetch master-only &&\n'> 
            <'\t git branch bad-upstream &&\n'> <'\t git config branch.bad-upstream.remote master-only &&\n'> 
            <'\t git config branch.bad-upstream.merge refs/heads/side\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'sq='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'sq='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sq='> name:sq)
          op: assign_op.Equal
          rhs: {(DQ <'\''>)}
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <full_name>
      name: full_name
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Subshell
              left: <Id.Op_LParen _>
              child: 
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <cd>
                      more_env: []
                      words: [{<cd>} {<clone>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<rev-parse>} {<--symbolic-full-name>} {(DQ ($ Id.VSub_At '@'))}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
              right: <Id.Right_Subshell _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <commit_subject>
      name: commit_subject
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Subshell
              left: <Id.Op_LParen _>
              child: 
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <cd>
                      more_env: []
                      words: [{<cd>} {<clone>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [
                        {<git>}
                        {<show>}
                        {<-s>}
                        {<--pretty> <Id.Lit_Equals '='> <format> <Id.Lit_Colon ':'> <Id.Lit_Other '%'> 
                          <s>
                        }
                        {(DQ ($ Id.VSub_At '@'))}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
              right: <Id.Right_Subshell _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <error_message>
      name: error_message
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Subshell
              left: <Id.Op_LParen _>
              child: 
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <cd>
                      more_env: []
                      words: [{<cd>} {<clone>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <test_must_fail>
                      more_env: []
                      words: [
                        {<test_must_fail>}
                        {<git>}
                        {<rev-parse>}
                        {<--verify>}
                        {(DQ ($ Id.VSub_At '@'))}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
              right: <Id.Right_Subshell _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{upstream} resolves to correct full name'>)}
        {(SQ <'\n'> <'\ttest refs/remotes/origin/master = "$(full_name @{upstream})"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{u} resolves to correct full name'>)}
        {(SQ <'\n'> <'\ttest refs/remotes/origin/master = "$(full_name @{u})"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'my-side@{upstream} resolves to correct full name'>)}
        {(SQ <'\n'> <'\ttest refs/remotes/origin/side = "$(full_name my-side@{u})"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'upstream of branch with @ in middle'>)}
        {
          (SQ <'\n'> <'\tfull_name fun@ny@{u} >actual &&\n'> 
            <'\techo refs/remotes/origin/side >expect &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'upstream of branch with @ at start'>)}
        {
          (SQ <'\n'> <'\tfull_name @funny@{u} >actual &&\n'> 
            <'\techo refs/remotes/origin/side >expect &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'upstream of branch with @ at end'>)}
        {
          (SQ <'\n'> <'\tfull_name funny@@{u} >actual &&\n'> 
            <'\techo refs/remotes/origin/side >expect &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'refs/heads/my-side@{upstream} does not resolve to my-side{upstream}'>)}
        {(SQ <'\n'> <'\ttest_must_fail full_name refs/heads/my-side@{upstream}\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'my-side@{u} resolves to correct commit'>)}
        {
          (SQ <'\n'> <'\tgit checkout side &&\n'> <'\ttest_commit 5 &&\n'> 
            <'\t(cd clone && git fetch) &&\n'> <'\ttest 2 = "$(commit_subject my-side)" &&\n'> <'\ttest 5 = "$(commit_subject my-side@{u})"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'not-tracking@{u} fails'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail full_name non-tracking@{u} &&\n'> 
            <'\t(cd clone && git checkout --no-track -b non-tracking) &&\n'> <'\ttest_must_fail full_name non-tracking@{u}\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'<branch>@{u}@{1} resolves correctly'>)}
        {
          (SQ <'\n'> <'\ttest_commit 6 &&\n'> <'\t(cd clone && git fetch) &&\n'> 
            <'\ttest 5 = $(commit_subject my-side@{u}@{1})\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{u} without specifying branch fails on a detached HEAD'>)}
        {(SQ <'\n'> <'\tgit checkout HEAD^0 &&\n'> <'\ttest_must_fail git rev-parse @{u}\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checkout -b new my-side@{u} forks from the same'>)}
        {
          (SQ <'\n'> <'(\n'> <'\tcd clone &&\n'> <'\tgit checkout -b new my-side@{u} &&\n'> 
            <'\tgit rev-parse --symbolic-full-name my-side@{u} >expect &&\n'> <'\tgit rev-parse --symbolic-full-name new@{u} >actual &&\n'> <'\ttest_cmp expect actual\n'> <')\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge my-side@{u} records the correct name'>)}
        {
          (SQ <'\n'> <'(\n'> <'\tcd clone || exit\n'> <'\tgit checkout master || exit\n'> 
            <'\tgit branch -D new ;# can fail but is ok\n'> <'\tgit branch -t new my-side@{u} &&\n'> <'\tgit merge -s ours new@{u} &&\n'> 
            <'\tgit show -s --pretty=tformat:%s >actual &&\n'> <'\techo "Merge remote-tracking branch ${sq}origin/side${sq}" >expect &&\n'> 
            <'\ttest_cmp expect actual\n'> <')\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'branch -d other@{u}'>)}
        {
          (SQ <'\n'> <'\tgit checkout -t -b other master &&\n'> <'\tgit branch -d @{u} &&\n'> 
            <'\tgit for-each-ref refs/heads/master >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checkout other@{u}'>)}
        {
          (SQ <'\n'> <'\tgit branch -f master HEAD &&\n'> <'\tgit checkout -t -b another master &&\n'> 
            <'\tgit checkout @{u} &&\n'> <'\tgit symbolic-ref HEAD >actual &&\n'> <'\techo refs/heads/master >expect &&\n'> 
            <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'branch@{u} works when tracking a local branch'>)}
        {(SQ <'\n'> <'\ttest refs/heads/master = "$(full_name local-master@{u})"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'branch@{u} error message when no upstream'>)}
        {
          (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> 
            <'\tfatal: no upstream configured for branch ${sq}non-tracking${sq}\n'> <'\tEOF\n'> <'\terror_message non-tracking@{u} 2>actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{u} error message when no upstream'>)}
        {
          (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> 
            <'\tfatal: no upstream configured for branch ${sq}master${sq}\n'> <'\tEOF\n'> <'\ttest_must_fail git rev-parse --verify @{u} 2>actual &&\n'> 
            <'\ttest_i18ncmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'branch@{u} error message with misspelt branch'>)}
        {
          (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> 
            <'\tfatal: no such branch: ${sq}no-such-branch${sq}\n'> <'\tEOF\n'> <'\terror_message no-such-branch@{u} 2>actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{u} error message when not on a branch'>)}
        {
          (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> <'\tfatal: HEAD does not point to a branch\n'> 
            <'\tEOF\n'> <'\tgit checkout HEAD^0 &&\n'> <'\ttest_must_fail git rev-parse --verify @{u} 2>actual &&\n'> 
            <'\ttest_i18ncmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'branch@{u} error message if upstream branch not fetched'>)}
        {
          (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> 
            <
'\tfatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch\n'
            > <'\tEOF\n'> <'\terror_message bad-upstream@{u} 2>actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'pull works when tracking a local branch'>)}
        {
          (SQ <'\n'> <'(\n'> <'\tcd clone &&\n'> <'\tgit checkout local-master &&\n'> <'\tgit pull\n'> 
            <')\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{u} works when tracking a local branch'>)}
        {(SQ <'\n'> <'\ttest refs/heads/master = "$(full_name @{u})"\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit 8f489d01d0cc65c3b0f09504ec50b5ed02a70bd5\n'>
                <'Reflog: master@{0} (C O Mitter <committer@example.com>)\n'>
                <'Reflog message: branch: Created from HEAD\n'>
                <'Author: A U Thor <author@example.com>\n'>
                <'Date:   Thu Apr 7 15:15:13 2005 -0700\n'>
                <'\n'>
                <'    3\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'log -g other@{u}'>)}
        {(SQ <'\n'> <'\tgit log -1 -g other@{u} >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit 8f489d01d0cc65c3b0f09504ec50b5ed02a70bd5\n'>
                <
'Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)\n'
                >
                <'Reflog message: branch: Created from HEAD\n'>
                <'Author: A U Thor <author@example.com>\n'>
                <'Date:   Thu Apr 7 15:15:13 2005 -0700\n'>
                <'\n'>
                <'    3\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'log -g other@{u}@{now}'>)}
        {(SQ <'\n'> <'\tgit log -1 -g other@{u}@{now} >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{reflog}-parsing does not look beyond colon'>)}
        {
          (SQ <'\n'> <'\techo content >@{yesterday} &&\n'> <'\tgit add @{yesterday} &&\n'> 
            <'\tgit commit -m "funny reflog file" &&\n'> <'\tgit hash-object @{yesterday} >expect &&\n'> <'\tgit rev-parse HEAD:@{yesterday} >actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'@{upstream}-parsing does not look beyond colon'>)}
        {
          (SQ <'\n'> <'\techo content >@{upstream} &&\n'> <'\tgit add @{upstream} &&\n'> 
            <'\tgit commit -m "funny upstream file" &&\n'> <'\tgit hash-object @{upstream} >expect &&\n'> <'\tgit rev-parse HEAD:@{upstream} >actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)