(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'Merge logic in fetch' span_id:18))}
          spids: [16]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LF)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'\n' span_id:29))}
          spids: [27]
        )
      ]
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:38) 
          (Token
            id: Id.Lit_Chars
            val: '\tGIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&\n'
            span_id: 39
          ) (Token id:Id.Lit_Chars val:'\tGIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&\n' span_id:40) 
          (Token
            id: Id.Lit_Chars
            val: '\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'
            span_id: 41
          ) (Token id:Id.Lit_Chars val:'\n' span_id:42) 
          (Token id:Id.Lit_Chars val:'\techo >file original &&\n' span_id:43) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:44) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m One &&\n' span_id:45) (Token id:Id.Lit_Chars val:'\tgit tag tag-one &&\n' span_id:46) 
          (Token id:Id.Lit_Chars val:'\tgit tag tag-one-tree HEAD^{tree} &&\n' span_id:47) (Token id:Id.Lit_Chars val:'\tgit branch one &&\n' span_id:48) 
          (Token id:Id.Lit_Chars val:'\n' span_id:49) (Token id:Id.Lit_Chars val:'\techo two >> file &&\n' span_id:50) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m Two &&\n' span_id:51) (Token id:Id.Lit_Chars val:'\tgit tag -a -m "Tag Two" tag-two &&\n' span_id:52) 
          (Token id:Id.Lit_Chars val:'\tgit branch two &&\n' span_id:53) (Token id:Id.Lit_Chars val:'\n' span_id:54) 
          (Token id:Id.Lit_Chars val:'\techo three >> file &&\n' span_id:55) (Token id:Id.Lit_Chars val:'\tgit commit -a -m Three &&\n' span_id:56) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit tag -a -m "Tag Three" tag-three &&\n'
            span_id: 57
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&\n'
            span_id: 58
          ) (Token id:Id.Lit_Chars val:'\tgit branch three &&\n' span_id:59) 
          (Token id:Id.Lit_Chars val:'\n' span_id:60) (Token id:Id.Lit_Chars val:'\techo master >> file &&\n' span_id:61) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m Master &&\n' span_id:62) (Token id:Id.Lit_Chars val:'\tgit tag -a -m "Tag Master" tag-master &&\n' span_id:63) 
          (Token id:Id.Lit_Chars val:'\n' span_id:64) (Token id:Id.Lit_Chars val:'\tgit checkout three &&\n' span_id:65) 
          (Token id:Id.Lit_Chars val:'\n' span_id:66) (Token id:Id.Lit_Chars val:'\tgit clone . cloned &&\n' span_id:67) 
          (Token id:Id.Lit_Chars val:'\tcd cloned &&\n' span_id:68) (Token id:Id.Lit_Chars val:'\tgit config remote.origin.url ../.git/ &&\n' span_id:69) 
          (Token id:Id.Lit_Chars val:'\n' span_id:70) (Token id:Id.Lit_Chars val:'\tgit config remote.config-explicit.url ../.git/ &&\n' span_id:71) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&\n'
            span_id: 72
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&\n'
            span_id: 73
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config --add remote.config-explicit.fetch two:remotes/rem/two &&\n'
            span_id: 74
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&\n'
            span_id: 75
          ) (Token id:Id.Lit_Chars val:'\tremotes="config-explicit" &&\n' span_id:76) 
          (Token id:Id.Lit_Chars val:'\n' span_id:77) (Token id:Id.Lit_Chars val:'\tgit config remote.config-glob.url ../.git/ &&\n' span_id:78) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n'
            span_id: 79
          ) (Token id:Id.Lit_Chars val:'\tremotes="$remotes config-glob" &&\n' span_id:80) 
          (Token id:Id.Lit_Chars val:'\n' span_id:81) (Token id:Id.Lit_Chars val:'\tmkdir -p .git/remotes &&\n' span_id:82) 
          (Token id:Id.Lit_Chars val:'\t{\n' span_id:83) (Token id:Id.Lit_Chars val:'\t\techo "URL: ../.git/"\n' span_id:84) 
          (Token
            id: Id.Lit_Chars
            val: '\t\techo "Pull: refs/heads/master:remotes/rem/master"\n'
            span_id: 85
          ) (Token id:Id.Lit_Chars val:'\t\techo "Pull: refs/heads/one:remotes/rem/one"\n' span_id:86) 
          (Token id:Id.Lit_Chars val:'\t\techo "Pull: two:remotes/rem/two"\n' span_id:87) (Token id:Id.Lit_Chars val:'\t\techo "Pull: refs/heads/three:remotes/rem/three"\n' span_id:88) 
          (Token id:Id.Lit_Chars val:'\t} >.git/remotes/remote-explicit &&\n' span_id:89) (Token id:Id.Lit_Chars val:'\tremotes="$remotes remote-explicit" &&\n' span_id:90) 
          (Token id:Id.Lit_Chars val:'\n' span_id:91) (Token id:Id.Lit_Chars val:'\t{\n' span_id:92) 
          (Token id:Id.Lit_Chars val:'\t\techo "URL: ../.git/"\n' span_id:93) (Token id:Id.Lit_Chars val:'\t\techo "Pull: refs/heads/*:refs/remotes/rem/*"\n' span_id:94) 
          (Token id:Id.Lit_Chars val:'\t} >.git/remotes/remote-glob &&\n' span_id:95) (Token id:Id.Lit_Chars val:'\tremotes="$remotes remote-glob" &&\n' span_id:96) 
          (Token id:Id.Lit_Chars val:'\n' span_id:97) (Token id:Id.Lit_Chars val:'\tmkdir -p .git/branches &&\n' span_id:98) 
          (Token
            id: Id.Lit_Chars
            val: '\techo "../.git" > .git/branches/branches-default &&\n'
            span_id: 99
          ) (Token id:Id.Lit_Chars val:'\tremotes="$remotes branches-default" &&\n' span_id:100) 
          (Token id:Id.Lit_Chars val:'\n' span_id:101) (Token id:Id.Lit_Chars val:'\techo "../.git#one" > .git/branches/branches-one &&\n' span_id:102) 
          (Token id:Id.Lit_Chars val:'\tremotes="$remotes branches-one" &&\n' span_id:103) (Token id:Id.Lit_Chars val:'\n' span_id:104) 
          (Token id:Id.Lit_Chars val:'\tfor remote in $remotes ; do\n' span_id:105) (Token id:Id.Lit_Chars val:'\t\tgit config branch.br-$remote.remote $remote &&\n' span_id:106) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.br-$remote-merge.remote $remote &&\n'
            span_id: 107
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.br-$remote-merge.merge refs/heads/three &&\n'
            span_id: 108
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.br-$remote-octopus.remote $remote &&\n'
            span_id: 109
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit config branch.br-$remote-octopus.merge refs/heads/one &&\n'
            span_id: 110
          ) (Token id:Id.Lit_Chars val:'\t\tgit config --add branch.br-$remote-octopus.merge two\n' span_id:111) 
          (Token id:Id.Lit_Chars val:'\tdone\n' span_id:112)
        )
      }
    )
    (command.ForEach
      iter_name: remote
      iter_words: [{($ Id.VSub_DollarName '$remotes')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ForEach
              iter_name: branch
              iter_words: [{(DQ )} {(DQ (-merge))} {(DQ (-octopus))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.Simple
                      words: [{(cat)}]
                      redirects: [
                        (redir.HereDoc
                          op: (Token id:Id.Redir_DLess val:'<<' span_id:155)
                          fd: -1
                          here_begin: {(EOF)}
                          here_end_span_id: 169
                          stdin_parts: [
                            (br-)
                            ($ Id.VSub_DollarName '$remote')
                            ($ Id.VSub_DollarName '$branch')
                            ('\n')
                            (br-)
                            ($ Id.VSub_DollarName '$remote')
                            ($ Id.VSub_DollarName '$branch')
                            (' ')
                            ($ Id.VSub_DollarName '$remote')
                            ('\n')
                          ]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:175) fd:-1 arg_word:{(tests)})
      ]
    )
    (command.ForEach
      iter_name: branch
      iter_words: [{(master)} {(br-unconfig)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {(echo)} {($ Id.VSub_DollarName '$branch')})
            (command.ForEach
              iter_name: remote
              iter_words: [{($ Id.VSub_DollarName '$remotes')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(echo)} {($ Id.VSub_DollarName '$branch')} {($ Id.VSub_DollarName '$remote')})
                  ]
                )
            )
          ]
        )
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_DGreat val:'>>' span_id:236)
          fd: -1
          arg_word: {(tests)}
        )
      ]
    )
    (command.ForEach
      iter_name: branch
      iter_words: [{(master)} {(br-unconfig)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:264)
                  fd: -1
                  here_begin: {(EOF)}
                  here_end_span_id: 282
                  stdin_parts: [
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git one\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git one two\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' --tags ../.git\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git tag tag-one tag tag-three\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git tag tag-one-tree tag tag-three-file\n')
                    ($ Id.VSub_DollarName '$branch')
                    (' ../.git one tag tag-one tag tag-three-file\n')
                  ]
                )
              ]
            )
          ]
        )
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_DGreat val:'>>' span_id:285)
          fd: -1
          arg_word: {(tests)}
        )
      ]
    )
    (command.WhileUntil
      keyword: (Token id:Id.KW_While val:while span_id:290)
      cond: [(C {(read)} {(cmd)})]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$cmd'))}
              arms: [
                (case_arm
                  pat_list: [
                    {(SQ )}
                    {(SQ (Token id:Id.Lit_Chars val:'#' span_id:314)) (Id.Lit_Star '*')}
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Continue val:continue span_id:319)
                    )
                  ]
                  spids: [308 317 321 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:test)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:328)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} {(DQ ($ Id.VSub_DollarName '$cmd'))})
                                  (C {(sed)} {(-e)} 
                                    {(SQ (Token id:Id.Lit_Chars val:'s|[/ ][/ ]*|_|g' span_id:342))}
                                  )
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [327]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:pfx)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:348)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(printf)} {(DQ ('%04d'))} {($ Id.VSub_DollarName '$test_count')})
                            ]
                          )
                      )
                    }
                  spids: [347]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expect_f)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY') (/t5515/fetch.) 
                        ($ Id.VSub_DollarName '$test')
                      )
                    }
                  spids: [359]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:actual_f)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$pfx') (-fetch.) ($ Id.VSub_DollarName '$test'))}
                  spids: [367]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expect_r)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY') (/t5515/refs.) 
                        ($ Id.VSub_DollarName '$test')
                      )
                    }
                  spids: [375]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:actual_r)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$pfx') (-refs.) ($ Id.VSub_DollarName '$test'))}
                  spids: [383]
                )
              ]
            )
            (C {(test_expect_success)} {(DQ ($ Id.VSub_DollarName '$cmd'))} 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:399) 
                  (Token id:Id.Lit_Chars val:'\t\t{\n' span_id:400) (Token id:Id.Lit_Chars val:'\t\t\techo "# $cmd"\n' span_id:401) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tset x $cmd; shift\n'
                    span_id: 402
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit symbolic-ref HEAD refs/heads/$1 ; shift\n' span_id:403) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\trm -f .git/FETCH_HEAD\n'
                    span_id: 404
                  ) (Token id:Id.Lit_Chars val:'\t\t\tgit for-each-ref \\\n' span_id:405) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t\trefs/heads refs/remotes/rem refs/tags |\n'
                    span_id: 406
                  ) (Token id:Id.Lit_Chars val:'\t\t\twhile read val type refname\n' span_id:407) 
                  (Token id:Id.Lit_Chars val:'\t\t\tdo\n' span_id:408) (Token id:Id.Lit_Chars val:'\t\t\t\tgit update-ref -d "$refname" "$val"\n' span_id:409) 
                  (Token id:Id.Lit_Chars val:'\t\t\tdone\n' span_id:410) (Token id:Id.Lit_Chars val:'\t\t\tgit fetch "$@" >/dev/null\n' span_id:411) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tcat .git/FETCH_HEAD\n'
                    span_id: 412
                  ) (Token id:Id.Lit_Chars val:'\t\t} >"$actual_f" &&\n' span_id:413) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tgit show-ref >"$actual_r" &&\n'
                    span_id: 414
                  ) (Token id:Id.Lit_Chars val:'\t\tif test -f "$expect_f"\n' span_id:415) 
                  (Token id:Id.Lit_Chars val:'\t\tthen\n' span_id:416) (Token id:Id.Lit_Chars val:'\t\t\ttest_cmp "$expect_f" "$actual_f" &&\n' span_id:417) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\trm -f "$actual_f"\n'
                    span_id: 418
                  ) (Token id:Id.Lit_Chars val:'\t\telse\n' span_id:419) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t# this is to help developing new tests.\n'
                    span_id: 420
                  ) (Token id:Id.Lit_Chars val:'\t\t\tcp "$actual_f" "$expect_f"\n' span_id:421) 
                  (Token id:Id.Lit_Chars val:'\t\t\tfalse\n' span_id:422) (Token id:Id.Lit_Chars val:'\t\tfi &&\n' span_id:423) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tif test -f "$expect_r"\n'
                    span_id: 424
                  ) (Token id:Id.Lit_Chars val:'\t\tthen\n' span_id:425) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\ttest_cmp "$expect_r" "$actual_r" &&\n'
                    span_id: 426
                  ) (Token id:Id.Lit_Chars val:'\t\t\trm -f "$actual_r"\n' span_id:427) 
                  (Token id:Id.Lit_Chars val:'\t\telse\n' span_id:428) (Token id:Id.Lit_Chars val:'\t\t\t# this is to help developing new tests.\n' span_id:429) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tcp "$actual_r" "$expect_r"\n'
                    span_id: 430
                  ) (Token id:Id.Lit_Chars val:'\t\t\tfalse\n' span_id:431) 
                  (Token id:Id.Lit_Chars val:'\t\tfi\n' span_id:432) (Token id:Id.Lit_Chars val:'\t' span_id:433)
                )
              }
            )
          ]
        )
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Less val:'<' span_id:438) fd:-1 arg_word:{(tests)})
      ]
    )
    (C {(test_done)})
  ]
)