(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git branch display tests'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {(SQ <'make commits'>)} 
      {
        (SQ <'\n'> <'\techo content >file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m one &&\n'> 
          <'\techo content >>file &&\n'> <'\tgit commit -a -m two\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'make branches'>)} 
      {(SQ <'\n'> <'\tgit branch branch-one &&\n'> <'\tgit branch branch-two HEAD^\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'make remote branches'>)} 
      {
        (SQ <'\n'> <'\tgit update-ref refs/remotes/origin/branch-one branch-one &&\n'> 
          <'\tgit update-ref refs/remotes/origin/branch-two branch-two &&\n'> <'\tgit symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/branch-one\n'>
        )
      }
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 70
              stdin_parts: [<'  branch-one\n'> <'  branch-two\n'> <'* master\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch shows local branches'>)} 
      {(SQ <'\n'> <'\tgit branch >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'git branch --list shows local branches'>)} 
      {(SQ <'\n'> <'\tgit branch --list >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 109
              stdin_parts: [<'  branch-one\n'> <'  branch-two\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch --list pattern shows matching local branches'>)} 
      {(SQ <'\n'> <'\tgit branch --list branch* >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 136
              stdin_parts: [
                <'  origin/HEAD -> origin/branch-one\n'>
                <'  origin/branch-one\n'>
                <'  origin/branch-two\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch -r shows remote branches'>)} 
      {(SQ <'\n'> <'\tgit branch -r >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 166
              stdin_parts: [
                <'  branch-one\n'>
                <'  branch-two\n'>
                <'* master\n'>
                <'  remotes/origin/HEAD -> origin/branch-one\n'>
                <'  remotes/origin/branch-one\n'>
                <'  remotes/origin/branch-two\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch -a shows local and remote branches'>)} 
      {(SQ <'\n'> <'\tgit branch -a >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 193
              stdin_parts: [<'two\n'> <'one\n'> <'two\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch -v shows branch summaries'>)} 
      {
        (SQ <'\n'> <'\tgit branch -v >tmp &&\n'> <'\tawk "{print \\$NF}" <tmp >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (command.Simple
      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.MultiLine
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 220
              stdin_parts: [<'two\n'> <'one\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'git branch --list -v pattern shows branch summaries'>)} 
      {
        (SQ <'\n'> <'\tgit branch --list -v branch* >tmp &&\n'> 
          <'\tawk "{print \\$NF}" <tmp >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch -v pattern does not show branch summaries'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git branch -v branch*\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'git branch shows detached HEAD properly'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<EOF &&\n'> 
          <'* (HEAD detached at $(git rev-parse --short HEAD^0))\n'> <'  branch-one\n'> <'  branch-two\n'> <'  master\n'> <'EOF\n'> <'\tgit checkout HEAD^0 &&\n'> 
          <'\tgit branch >actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} 
      {(SQ <'git branch shows detached HEAD properly after checkout --detach'>)} 
      {
        (SQ <'\n'> <'\tgit checkout master &&\n'> <'\tcat >expect <<EOF &&\n'> 
          <'* (HEAD detached at $(git rev-parse --short HEAD^0))\n'> <'  branch-one\n'> <'  branch-two\n'> <'  master\n'> <'EOF\n'> <'\tgit checkout --detach &&\n'> 
          <'\tgit branch >actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch shows detached HEAD properly after moving'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<EOF &&\n'> 
          <'* (HEAD detached from $(git rev-parse --short HEAD))\n'> <'  branch-one\n'> <'  branch-two\n'> <'  master\n'> <'EOF\n'> <'\tgit reset --hard HEAD^1 &&\n'> 
          <'\tgit branch >actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch shows detached HEAD properly from tag'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<EOF &&\n'> <'* (HEAD detached at fromtag)\n'> <'  branch-one\n'> 
          <'  branch-two\n'> <'  master\n'> <'EOF\n'> <'\tgit tag fromtag master &&\n'> <'\tgit checkout fromtag &&\n'> 
          <'\tgit branch >actual &&\n'> <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch shows detached HEAD properly after moving from tag'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<EOF &&\n'> <'* (HEAD detached from fromtag)\n'> <'  branch-one\n'> 
          <'  branch-two\n'> <'  master\n'> <'EOF\n'> <'\tgit reset --hard HEAD^1 &&\n'> <'\tgit branch >actual &&\n'> 
          <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch `--sort` option'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t* (HEAD detached from fromtag)\n'> 
          <'\t  branch-two\n'> <'\t  branch-one\n'> <'\t  master\n'> <'\tEOF\n'> <'\tgit branch --sort=objectsize >actual &&\n'> 
          <'\ttest_i18ncmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'git branch --points-at option'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t  branch-one\n'> <'\t  master\n'> <'\tEOF\n'> 
          <'\tgit branch --points-at=branch-one >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'ambiguous branch/tag not marked'>)} 
      {
        (SQ <'\n'> <'\tgit tag ambiguous &&\n'> <'\tgit branch ambiguous &&\n'> 
          <'\techo "  ambiguous" >expect &&\n'> <'\tgit branch --list ambiguous >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'local-branch symrefs shortened properly'>)} 
      {
        (SQ <'\n'> <'\tgit symbolic-ref refs/heads/ref-to-branch refs/heads/branch-one &&\n'> 
          <'\tgit symbolic-ref refs/heads/ref-to-remote refs/remotes/origin/branch-one &&\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t  ref-to-branch -> branch-one\n'> 
          <'\t  ref-to-remote -> refs/remotes/origin/branch-one\n'> <'\tEOF\n'> <'\tgit branch >actual.raw &&\n'> <'\tgrep ref-to <actual.raw >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)