(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'fetch --all works correctly'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: setup_repository
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Number '$1'))})
                (Subshell
                  child: 
                    (AndOr
                      ops: [
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                        Op_DAmp
                      ]
                      children: [
                        (C {(cd)} {(DQ ($ VSub_Number '$1'))})
                        (C {(git)} {(init)})
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(file)}
                              spids: [50]
                            )
                          ]
                        )
                        (C {(git)} {(add)} {(file)})
                        (C {(test_tick)})
                        (C {(git)} {(commit)} {(-m)} {(DQ (Initial))})
                        (C {(git)} {(checkout)} {(-b)} {(side)})
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(KW_Elif elif)}
                              spids: [94]
                            )
                          ]
                        )
                        (C {(git)} {(add)} {(KW_Elif elif)})
                        (C {(test_tick)})
                        (C {(git)} {(commit)} {(-m)} {(DQ (Second))})
                        (C {(git)} {(checkout)} {(master)})
                      ]
                    )
                  spids: [31 134]
                )
              ]
            )
          ]
          spids: [20]
        )
      spids: [15 19]
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <'\n'> <'\tsetup_repository one &&\n'> <'\tsetup_repository two &&\n'> <'\t(\n'> 
          <'\t\tcd two && git branch another\n'> <'\t) &&\n'> <'\tgit clone --mirror two three &&\n'> <'\tgit clone one test\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(test/expect)} spids:[157])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {
              (DQ ('  one/master\n') ('  one/side\n') ('  origin/HEAD -> origin/master\n') 
                ('  origin/master\n') ('  origin/side\n') ('  three/another\n') ('  three/master\n') ('  three/side\n') ('  two/another\n') 
                ('  two/master\n') ('  two/side\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [161]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all'>)} 
      {
        (SQ <'\n'> <'\t(cd test &&\n'> <'\t git remote add one ../one &&\n'> 
          <'\t git remote add two ../two &&\n'> <'\t git remote add three ../three &&\n'> <'\t git fetch --all &&\n'> 
          <'\t git branch -r > output &&\n'> <'\t test_cmp expect output)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all should continue if a remote has errors'>)} 
      {
        (SQ <'\n'> <'\t(git clone one test2 &&\n'> <'\t cd test2 &&\n'> 
          <'\t git remote add bad ../non-existing &&\n'> <'\t git remote add one ../one &&\n'> <'\t git remote add two ../two &&\n'> 
          <'\t git remote add three ../three &&\n'> <'\t test_must_fail git fetch --all &&\n'> <'\t git branch -r > output &&\n'> 
          <'\t test_cmp ../test/expect output)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all does not allow non-option arguments'>)} 
      {
        (SQ <'\n'> <'\t(cd test &&\n'> <'\t test_must_fail git fetch --all origin &&\n'> 
          <'\t test_must_fail git fetch --all origin master)\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[232])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {
              (DQ ('  origin/HEAD -> origin/master\n') ('  origin/master\n') ('  origin/side\n') 
                ('  three/another\n') ('  three/master\n') ('  three/side\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [236]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git fetch --multiple (but only one remote)'>)} 
      {
        (SQ <'\n'> <'\t(git clone one test3 &&\n'> <'\t cd test3 &&\n'> 
          <'\t git remote add three ../three &&\n'> <'\t git fetch --multiple three &&\n'> <'\t git branch -r > output &&\n'> 
          <'\t test_cmp ../expect output)\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[267])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {
              (DQ ('  one/master\n') ('  one/side\n') ('  two/another\n') ('  two/master\n') 
                ('  two/side\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [271]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git fetch --multiple (two remotes)'>)} 
      {
        (SQ <'\n'> <'\t(git clone one test4 &&\n'> <'\t cd test4 &&\n'> <'\t git remote rm origin &&\n'> 
          <'\t git remote add one ../one &&\n'> <'\t git remote add two ../two &&\n'> <'\t git fetch --multiple one two &&\n'> 
          <'\t git branch -r > output &&\n'> <'\t test_cmp ../expect output)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git fetch --multiple (bad remote names)'>)} 
      {(SQ <'\n'> <'\t(cd test4 &&\n'> <'\t test_must_fail git fetch --multiple four)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all (skipFetchAll)'>)} 
      {
        (SQ <'\n'> <'\t(cd test4 &&\n'> <'\t for b in $(git branch -r)\n'> <'\t do\n'> 
          <'\t\tgit branch -r -d $b || exit 1\n'> <'\t done &&\n'> <'\t git remote add three ../three &&\n'> 
          <'\t git config remote.three.skipFetchAll true &&\n'> <'\t git fetch --all &&\n'> <'\t git branch -r > output &&\n'> <'\t test_cmp ../expect output)\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[338])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {
              (DQ ('  one/master\n') ('  one/side\n') ('  three/another\n') ('  three/master\n') 
                ('  three/side\n') ('  two/another\n') ('  two/master\n') ('  two/side\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [342]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git fetch --multiple (ignoring skipFetchAll)'>)} 
      {
        (SQ <'\n'> <'\t(cd test4 &&\n'> <'\t for b in $(git branch -r)\n'> <'\t do\n'> 
          <'\t\tgit branch -r -d $b || exit 1\n'> <'\t done &&\n'> <'\t git fetch --multiple one two three &&\n'> <'\t git branch -r > output &&\n'> 
          <'\t test_cmp ../expect output)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all --no-tags'>)} 
      {
        (SQ <'\n'> <'\t>expect &&\n'> <'\tgit clone one test5 &&\n'> <'\tgit clone test5 test6 &&\n'> 
          <'\t(cd test5 && git tag test-tag) &&\n'> <'\t(\n'> <'\t\tcd test6 &&\n'> <'\t\tgit fetch --all --no-tags &&\n'> <'\t\tgit tag >output\n'> 
          <'\t) &&\n'> <'\ttest_cmp expect test6/output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git fetch --all --tags'>)} 
      {
        (SQ <'\n'> <'\techo test-tag >expect &&\n'> <'\tgit clone one test7 &&\n'> 
          <'\tgit clone test7 test8 &&\n'> <'\t(\n'> <'\t\tcd test7 &&\n'> <'\t\ttest_commit test-tag &&\n'> <'\t\tgit reset --hard HEAD^\n'> 
          <'\t) &&\n'> <'\t(\n'> <'\t\tcd test8 &&\n'> <'\t\tgit fetch --all --tags &&\n'> <'\t\tgit tag >output\n'> 
          <'\t) &&\n'> <'\ttest_cmp expect test8/output\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)