(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[21])
          op: Equal
          rhs: {(SQ <'Testing multi_ack pack fetching'>)}
          spids: [21]
        )
      ]
      spids: [21]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.FuncDef
      name: add
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
                Op_DAmp
              ]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:name spids:[48])
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                      spids: [48]
                    )
                  ]
                  spids: [48]
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:text spids:[54])
                      op: Equal
                      rhs: {(DQ ($ VSub_At '$@'))}
                      spids: [54]
                    )
                  ]
                  spids: [54]
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:branch spids:[62])
                      op: Equal
                      rhs: 
                        {
                          (word_part.CommandSubPart
                            command_list: 
                              (command.CommandList
                                children: [
                                  (command.Pipeline
                                    children: [
                                      (C {(echo)} {($ VSub_Name '$name')})
                                      (C {(sed)} {(-e)} {(SQ <'s/^\\(.\\).*$/\\1/'>)})
                                    ]
                                    negated: F
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [63 77]
                          )
                        }
                      spids: [62]
                    )
                  ]
                  spids: [62]
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:parents spids:[82])
                      op: Equal
                      rhs: {(DQ )}
                      spids: [82]
                    )
                  ]
                  spids: [82]
                )
                (C {(shift)})
                (command.WhileUntil
                  keyword: <KW_While while>
                  cond: [
                    (command.Sentence
                      child: (C {(test)} {($ VSub_Number '$1')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  body: 
                    (command.DoGroup
                      children: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:parents spids:[105])
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$parents') (' -p ') ($ VSub_Number '$1'))}
                                  spids: [105]
                                )
                              ]
                              spids: [105]
                            )
                            (C {(shift)})
                          ]
                        )
                      ]
                      spids: [102 118]
                    )
                )
                (command.SimpleCommand
                  words: [{(echo)} {(DQ ($ VSub_Name '$text'))}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(test.txt)})]
                )
                (C {(git)} {(update-index)} {(--add)} {(test.txt)})
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:tree spids:[148])
                      op: Equal
                      rhs: 
                        {
                          (word_part.CommandSubPart
                            command_list: (command.CommandList children:[(C {(git)} {(write-tree)})])
                            left_token: <Left_CommandSub '$('>
                            spids: [149 153]
                          )
                        }
                      spids: [148]
                    )
                  ]
                  spids: [148]
                )
                (C {(test_tick)})
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:commit spids:[167])
                      op: Equal
                      rhs: 
                        {
                          (word_part.CommandSubPart
                            command_list: 
                              (command.CommandList
                                children: [
                                  (command.Pipeline
                                    children: [
                                      (C {(echo)} {(DQ ($ VSub_Name '$text'))})
                                      (C {(git)} {(commit-tree)} {($ VSub_Name '$tree')} 
                                        {($ VSub_Name '$parents')}
                                      )
                                    ]
                                    negated: F
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [168 184]
                          )
                        }
                      spids: [167]
                    )
                  ]
                  spids: [167]
                )
                (C {(eval)} 
                  {
                    (DQ ($ VSub_Name '$name') ('=') ($ VSub_Name '$commit') ('; export ') 
                      ($ VSub_Name '$name')
                    )
                  }
                )
                (command.SimpleCommand
                  words: [{(echo)} {($ VSub_Name '$commit')}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(.git/refs/heads/) ($ VSub_Name '$branch')}
                    )
                  ]
                )
                (C {(eval)} {(${ VSub_Name branch) (Lit_VarLike 'TIP=') ($ VSub_Name '$commit')})
              ]
            )
          ]
          spids: [45]
        )
      spids: [40 44]
    )
    (command.FuncDef
      name: pull_to_client
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:number spids:[233])
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                      spids: [233]
                    )
                  ]
                  spids: [233]
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:heads spids:[239])
                      op: Equal
                      rhs: {($ VSub_Number '$2')}
                      spids: [239]
                    )
                  ]
                  spids: [239]
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:count spids:[245])
                      op: Equal
                      rhs: {($ VSub_Number '$3')}
                      spids: [245]
                    )
                  ]
                  spids: [245]
                )
                (C {(test_expect_success)} {(DQ ($ VSub_Name '$number') (' pull'))} 
                  {
                    (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd client &&\n'> 
                      <'\t\t\tgit fetch-pack -k -v .. $heads &&\n'> <'\n'> <'\t\t\tcase "$heads" in\n'> <'\t\t\t    *A*)\n'> 
                      <'\t\t\t\t    echo $ATIP > .git/refs/heads/A;;\n'> <'\t\t\tesac &&\n'> <'\t\t\tcase "$heads" in *B*)\n'> <'\t\t\t    echo $BTIP > .git/refs/heads/B;;\n'> 
                      <'\t\t\tesac &&\n'> <'\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n'> 
                      <'\t\t\t\t| sed -e "s/^\\(.\\).*$/\\1/") &&\n'> <'\n'> <'\t\t\tgit fsck --full &&\n'> <'\n'> <'\t\t\tmv .git/objects/pack/pack-* . &&\n'> 
                      <'\t\t\tp=$(ls -1 pack-*.pack) &&\n'> <'\t\t\tgit unpack-objects <$p &&\n'> <'\t\t\tgit fsck --full &&\n'> <'\n'> 
                      <'\t\t\tidx=$(echo pack-*.idx) &&\n'> <'\t\t\tpack_count=$(git show-index <$idx | wc -l) &&\n'> <'\t\t\ttest $pack_count = $count &&\n'> 
                      <'\t\t\trm -f pack-*\n'> <'\t\t)\n'> <'\t'>
                    )
                  }
                )
              ]
            )
          ]
          spids: [230]
        )
      spids: [225 229]
    )
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\tmkdir client &&\n'> <'\t(\n'> <'\t\tcd client &&\n'> <'\t\tgit init &&\n'> 
          <'\t\tgit config transfer.unpacklimit 0\n'> <'\t) &&\n'> <'\tadd A1 &&\n'> <'\tprev=1 &&\n'> <'\tcur=2 &&\n'> <'\twhile [ $cur -le 10 ]; do\n'> 
          <'\t\tadd A$cur $(eval echo \\$A$prev) &&\n'> <'\t\tprev=$cur &&\n'> <'\t\tcur=$(($cur+1))\n'> <'\tdone &&\n'> <'\tadd B1 $A1 &&\n'> 
          <'\techo $ATIP > .git/refs/heads/A &&\n'> <'\techo $BTIP > .git/refs/heads/B &&\n'> <'\tgit symbolic-ref HEAD refs/heads/B\n'>
        )
      }
    )
    (C {(pull_to_client)} {(1st)} {(DQ ('refs/heads/B refs/heads/A'))} 
      {
        (word_part.ArithSubPart
          anode: 
            (arith_expr.ArithBinary
              op_id: Arith_Star
              left: (arith_expr.ArithWord w:{(Lit_Digits 11)})
              right: (arith_expr.ArithWord w:{(Lit_Digits 3)})
            )
          spids: [347 352]
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'post 1st pull setup'>)} 
      {
        (SQ <'\n'> <'\tadd A11 $A10 &&\n'> <'\tprev=1 &&\n'> <'\tcur=2 &&\n'> 
          <'\twhile [ $cur -le 65 ]; do\n'> <'\t\tadd B$cur $(eval echo \\$B$prev) &&\n'> <'\t\tprev=$cur &&\n'> <'\t\tcur=$(($cur+1))\n'> 
          <'\tdone\n'>
        )
      }
    )
    (C {(pull_to_client)} {(2nd)} {(DQ (refs/heads/B))} 
      {
        (word_part.ArithSubPart
          anode: 
            (arith_expr.ArithBinary
              op_id: Arith_Star
              left: (arith_expr.ArithWord w:{(Lit_Digits 64)})
              right: (arith_expr.ArithWord w:{(Lit_Digits 3)})
            )
          spids: [382 387]
        )
      }
    )
    (C {(pull_to_client)} {(3rd)} {(DQ (refs/heads/A))} 
      {
        (word_part.ArithSubPart
          anode: 
            (arith_expr.ArithBinary
              op_id: Arith_Star
              left: (arith_expr.ArithWord w:{(Lit_Digits 1)})
              right: (arith_expr.ArithWord w:{(Lit_Digits 3)})
            )
          spids: [398 403]
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'single branch clone'>)} 
      {(SQ <'\n'> <'\tgit clone --single-branch "file://$(pwd)/." singlebranch\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'single branch object count'>)} 
      {
        (SQ <'\n'> <'\tGIT_DIR=singlebranch/.git git count-objects -v |\n'> 
          <'\t\tgrep "^in-pack:" > count.singlebranch &&\n'> <'\techo "in-pack: 198" >expected &&\n'> <'\ttest_cmp expected count.singlebranch\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'single given branch clone'>)} 
      {
        (SQ <'\n'> <'\tgit clone --single-branch --branch A "file://$(pwd)/." branch-a &&\n'> 
          <'\ttest_must_fail git --git-dir=branch-a/.git rev-parse origin/B\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow depth 1'>)} 
      {
        (SQ <'\n'> <'\tgit clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&\n'> 
          <'\ttest "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow depth 1 with fsck'>)} 
      {
        (SQ <'\n'> <'\tgit config --global fetch.fsckobjects true &&\n'> 
          <'\tgit clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&\n'> <'\ttest "$(git --git-dir=shallow0fsck/.git rev-list --count HEAD)" = 1 &&\n'> 
          <'\tgit config --global --unset fetch.fsckobjects\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow'>)} 
      {(SQ <'\n'> <'\tgit clone --no-single-branch --depth 2 "file://$(pwd)/." shallow\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow depth count'>)} 
      {(SQ <'\n'> <'\ttest "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 2\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow &&\n'> <'\tgrep "^in-pack: 12" count.shallow\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count (part 2)'>)} 
      {
        (SQ <'\n'> <'\tsed -e "/^in-pack:/d" -e "/^packs:/d" -e "/^size-pack:/d" \\\n'> 
          <'\t    -e "/: 0$/d" count.shallow > count_output &&\n'> <'\t! test -s count_output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fsck in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fsck --full\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'simple fetch in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'no changes expected'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow.2 &&\n'> <'\tcmp count.shallow count.shallow.2\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch same depth in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch --depth=2\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'no changes expected'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow.3 &&\n'> <'\tcmp count.shallow count.shallow.3\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add two more'>)} 
      {(SQ <'\n'> <'\tadd B66 $B65 &&\n'> <'\tadd B67 $B66\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'pull in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit pull .. B\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow &&\n'> <'\tgrep "^count: 6" count.shallow\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add two more (part 2)'>)} 
      {(SQ <'\n'> <'\tadd B68 $B67 &&\n'> <'\tadd B69 $B68\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'deepening pull in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit pull --depth 4 .. B\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow &&\n'> <'\tgrep "^count: 12" count.shallow\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'deepening fetch in shallow repo'>)} 
      {(SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch --depth 4 .. A:A\n'> <'\t)\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow &&\n'> <'\tgrep "^count: 18" count.shallow\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'pull in shallow repo with missing merge base'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch --depth 4 .. A\n'> 
          <'\t\ttest_must_fail git merge --allow-unrelated-histories FETCH_HEAD\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'additional simple shallow deepenings'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch --depth=8 &&\n'> 
          <'\t\tgit fetch --depth=10 &&\n'> <'\t\tgit fetch --depth=11\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow depth count'>)} 
      {(SQ <'\n'> <'\ttest "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 11\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit prune &&\n'> 
          <'\t\tgit count-objects -v\n'> <'\t) > count.shallow &&\n'> <'\tgrep "^count: 54" count.shallow\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch --no-shallow on full repo'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git fetch --noshallow\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'fetch --depth --no-shallow'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> 
          <'\t\ttest_must_fail git fetch --depth=1 --noshallow\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'turn shallow to complete repository'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow &&\n'> <'\t\tgit fetch --unshallow &&\n'> 
          <'\t\t! test -f .git/shallow &&\n'> <'\t\tgit fsck --full\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow without --no-single-branch'>)} 
      {(SQ <'\n'> <'\tgit clone --depth 1 "file://$(pwd)/." shallow2\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd shallow2 &&\n'> <'\t\tgit count-objects -v\n'> 
          <'\t) > count.shallow2 &&\n'> <'\tgrep "^in-pack: 3" count.shallow2\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow with --branch'>)} 
      {(SQ <'\n'> <'\tgit clone --depth 1 --branch A "file://$(pwd)/." shallow3\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow object count'>)} 
      {
        (SQ <'\n'> <'\techo "in-pack: 3" > count3.expected &&\n'> 
          <'\tGIT_DIR=shallow3/.git git count-objects -v |\n'> <'\t\tgrep "^in-pack" > count3.actual &&\n'> <'\ttest_cmp count3.expected count3.actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow with detached HEAD'>)} 
      {
        (SQ <'\n'> <'\tgit checkout HEAD^ &&\n'> 
          <'\tgit clone --depth 1 "file://$(pwd)/." shallow5 &&\n'> <'\tgit checkout - &&\n'> <'\tGIT_DIR=shallow5/.git git rev-parse HEAD >actual &&\n'> 
          <'\tgit rev-parse HEAD^ >expected &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'shallow clone pulling tags'>)} 
      {
        (SQ <'\n'> <'\tgit tag -a -m A TAGA1 A &&\n'> <'\tgit tag -a -m B TAGB1 B &&\n'> 
          <'\tgit tag TAGA2 A &&\n'> <'\tgit tag TAGB2 B &&\n'> <'\tgit clone --depth 1 "file://$(pwd)/." shallow6 &&\n'> <'\n'> 
          <'\tcat >taglist.expected <<\\EOF &&\n'> <'TAGB1\n'> <'TAGB2\n'> <'EOF\n'> <'\tGIT_DIR=shallow6/.git git tag -l >taglist.actual &&\n'> 
          <'\ttest_cmp taglist.expected taglist.actual &&\n'> <'\n'> <'\techo "in-pack: 4" > count6.expected &&\n'> 
          <'\tGIT_DIR=shallow6/.git git count-objects -v |\n'> <'\t\tgrep "^in-pack" > count6.actual &&\n'> <'\ttest_cmp count6.expected count6.actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'shallow cloning single tag'>)} 
      {
        (SQ <'\n'> <'\tgit clone --depth 1 --branch=TAGB1 "file://$(pwd)/." shallow7 &&\n'> 
          <'\tcat >taglist.expected <<\\EOF &&\n'> <'TAGB1\n'> <'TAGB2\n'> <'EOF\n'> <'\tGIT_DIR=shallow7/.git git tag -l >taglist.actual &&\n'> 
          <'\ttest_cmp taglist.expected taglist.actual &&\n'> <'\n'> <'\techo "in-pack: 4" > count7.expected &&\n'> 
          <'\tGIT_DIR=shallow7/.git git count-objects -v |\n'> <'\t\tgrep "^in-pack" > count7.actual &&\n'> <'\ttest_cmp count7.expected count7.actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'clone shallow with packed refs'>)} 
      {
        (SQ <'\n'> <'\tgit pack-refs --all &&\n'> 
          <'\tgit clone --depth 1 --branch A "file://$(pwd)/." shallow8 &&\n'> <'\techo "in-pack: 4" > count8.expected &&\n'> <'\tGIT_DIR=shallow8/.git git count-objects -v |\n'> 
          <'\t\tgrep "^in-pack" > count8.actual &&\n'> <'\ttest_cmp count8.expected count8.actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch in shallow repo unreachable shallow objects'>)} 
      {
        (SQ <'\n'> <'\t(\n'> 
          <'\t\tgit clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&\n'> <'\t\tgit clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&\n'> <'\t\tcd no-reflog &&\n'> 
          <'\t\tgit tag -d TAGB1 TAGB2 &&\n'> <'\t\tgit update-ref refs/heads/B B~~ &&\n'> <'\t\tgit gc --prune=now &&\n'> 
          <'\t\tcd ../shallow9 &&\n'> <'\t\tgit fetch origin &&\n'> <'\t\tgit fsck --no-dangling\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch creating new shallow root'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tgit clone "file://$(pwd)/." shallow10 &&\n'> 
          <'\t\tgit commit --allow-empty -m empty &&\n'> <'\t\tcd shallow10 &&\n'> <'\t\tgit fetch --depth=1 --progress 2>actual &&\n'> 
          <'\t\t# This should fetch only the empty commit, no tree or\n'> <'\t\t# blob objects\n'> <'\t\tgrep "remote: Total 1" actual\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'setup tests for the --stdin parameter'>)} 
      {
        (SQ <'\n'> <'\tfor head in C D E F\n'> <'\tdo\n'> <'\t\tadd $head\n'> <'\tdone &&\n'> 
          <'\tfor head in A B C D E F\n'> <'\tdo\n'> <'\t\tgit tag $head $head\n'> <'\tdone &&\n'> <'\tcat >input <<-\\EOF &&\n'> 
          <'\trefs/heads/C\n'> <'\trefs/heads/A\n'> <'\trefs/heads/D\n'> <'\trefs/tags/C\n'> <'\trefs/heads/B\n'> <'\trefs/tags/A\n'> 
          <'\trefs/heads/E\n'> <'\trefs/tags/B\n'> <'\trefs/tags/E\n'> <'\trefs/tags/D\n'> <'\tEOF\n'> <'\tsort <input >expect &&\n'> 
          <'\t(\n'> <'\t\techo refs/heads/E &&\n'> <'\t\techo refs/tags/E &&\n'> <'\t\tcat input\n'> <'\t) >input.dup\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch refs from cmdline'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\tgit fetch-pack --no-progress .. $(cat ../input)\n'> <'\t) >output &&\n'> <'\tcut -d " " -f 2 <output | sort >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch refs from stdin'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\tgit fetch-pack --stdin --no-progress .. <../input\n'> <'\t) >output &&\n'> <'\tcut -d " " -f 2 <output | sort >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch mixed refs from cmdline and stdin'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> <'\t\ttail -n +5 ../input |\n'> 
          <'\t\tgit fetch-pack --stdin --no-progress .. $(head -n 4 ../input)\n'> <'\t) >output &&\n'> <'\tcut -d " " -f 2 <output | sort >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test duplicate refs from stdin'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\tcd client &&\n'> 
          <'\tgit fetch-pack --stdin --no-progress .. <../input.dup\n'> <'\t) >output &&\n'> <'\tcut -d " " -f 2 <output | sort >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'set up tests of missing reference'>)} 
      {
        (SQ <'\n'> <'\tcat >expect-error <<-\\EOF\n'> 
          <'\terror: no such remote ref refs/heads/xyzzy\n'> <'\tEOF\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test lonely missing ref'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\ttest_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy\n'> <'\t) >/dev/null 2>error-m &&\n'> <'\ttest_cmp expect-error error-m\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test missing ref after existing'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\ttest_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy\n'> <'\t) >/dev/null 2>error-em &&\n'> <'\ttest_cmp expect-error error-em\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test missing ref before existing'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\ttest_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A\n'> <'\t) >/dev/null 2>error-me &&\n'> <'\ttest_cmp expect-error error-me\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test --all, --depth, and explicit head'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\tgit fetch-pack --no-progress --all --depth=1 .. refs/heads/A\n'> <'\t) >out-adh 2>error-adh\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'test --all, --depth, and explicit tag'>)} 
      {
        (SQ <'\n'> <'\tgit tag OLDTAG refs/heads/B~5 &&\n'> <'\t(\n'> <'\t\tcd client &&\n'> 
          <'\t\tgit fetch-pack --no-progress --all --depth=1 .. refs/tags/OLDTAG\n'> <'\t) >out-adt 2>error-adt\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'shallow fetch with tags does not break the repository'>)} 
      {
        (SQ <'\n'> <'\tmkdir repo1 &&\n'> <'\t(\n'> <'\t\tcd repo1 &&\n'> <'\t\tgit init &&\n'> 
          <'\t\ttest_commit 1 &&\n'> <'\t\ttest_commit 2 &&\n'> <'\t\ttest_commit 3 &&\n'> <'\t\tmkdir repo2 &&\n'> <'\t\tcd repo2 &&\n'> 
          <'\t\tgit init &&\n'> <'\t\tgit fetch --depth=2 ../.git master:branch &&\n'> <'\t\tgit fsck\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch-pack can fetch a raw sha1'>)} 
      {
        (SQ <'\n'> <'\tgit init hidden &&\n'> <'\t(\n'> <'\t\tcd hidden &&\n'> <'\t\ttest_commit 1 &&\n'> 
          <'\t\ttest_commit 2 &&\n'> <'\t\tgit update-ref refs/hidden/one HEAD^ &&\n'> 
          <'\t\tgit config transfer.hiderefs refs/hidden &&\n'> <'\t\tgit config uploadpack.allowtipsha1inwant true\n'> <'\t) &&\n'> 
          <'\tgit fetch-pack hidden $(git -C hidden rev-parse refs/hidden/one)\n'>
        )
      }
    )
    (command.FuncDef
      name: check_prot_path
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [{(cat)}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(expected)}
                    )
                    (redir.HereDoc
                      op: <Redir_DLessDash '<<-'>
                      fd: 16777215
                      here_begin: {(EOF)}
                      here_end_span_id: 1283
                      stdin_parts: [
                        ('Diag: url=')
                        ($ VSub_Number '$1')
                        ('\n')
                        ('Diag: protocol=')
                        ($ VSub_Number '$2')
                        ('\n')
                        ('Diag: path=')
                        ($ VSub_Number '$3')
                        ('\n')
                      ]
                    )
                  ]
                )
                (command.Pipeline
                  children: [
                    (C {(git)} {(fetch-pack)} {(--diag-url)} {(DQ ($ VSub_Number '$1'))})
                    (command.SimpleCommand
                      words: [{(grep)} {(-v)} {(Lit_VarLike 'hostandport=')}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual)})]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(expected)} {(actual)})
              ]
            )
          ]
          spids: [1260]
        )
      spids: [1255 1259]
    )
    (command.FuncDef
      name: check_prot_host_port_path
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ VSub_Number '$2'))}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (ssh) (Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:pp spids:[1341])
                          op: Equal
                          rhs: {(ssh)}
                          spids: [1341]
                        )
                      ]
                      spids: [1341]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:uah spids:[1345])
                          op: Equal
                          rhs: {(userandhost)}
                          spids: [1345]
                        )
                      ]
                      spids: [1345]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:ehost spids:[1349])
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {(echo)} {($ VSub_Number '$3')})
                                          (C {(tr)} {(-d)} {(DQ ('[]'))})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [1350 1364]
                              )
                            }
                          spids: [1349]
                        )
                      ]
                      spids: [1349]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:diagport spids:[1367])
                          op: Equal
                          rhs: {(DQ ('Diag: port=') ($ VSub_Number '$4'))}
                          spids: [1367]
                        )
                      ]
                      spids: [1367]
                    )
                  ]
                  spids: [1335 1338 1374 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:pp spids:[1381])
                          op: Equal
                          rhs: {($ VSub_Name '$p')}
                          spids: [1381]
                        )
                      ]
                      spids: [1381]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:uah spids:[1385])
                          op: Equal
                          rhs: {(hostandport)}
                          spids: [1385]
                        )
                      ]
                      spids: [1385]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:ehost spids:[1389])
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {(echo)} {($ VSub_Number '$3') ($ VSub_Number '$4')})
                                          (C {(sed)} {(-e)} {(DQ (s/22) (Lit_Other '$') ('/:22/'))} 
                                            {(-e)} {(DQ (s/NONE//))}
                                          )
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [1390 1413]
                              )
                            }
                          spids: [1389]
                        )
                      ]
                      spids: [1389]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:diagport spids:[1416])
                          op: Equal
                          rhs: {(DQ )}
                          spids: [1416]
                        )
                      ]
                      spids: [1416]
                    )
                  ]
                  spids: [1377 1378 1421 16777215]
                )
              ]
              spids: [1326 1332 1424]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [{(cat)}]
                  redirects: [
                    (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(exp)})
                    (redir.HereDoc
                      op: <Redir_DLessDash '<<-'>
                      fd: 16777215
                      here_begin: {(EOF)}
                      here_end_span_id: 1454
                      stdin_parts: [
                        ('Diag: url=')
                        ($ VSub_Number '$1')
                        ('\n')
                        ('Diag: protocol=')
                        ($ VSub_Name '$pp')
                        ('\n')
                        ('Diag: ')
                        ($ VSub_Name '$uah')
                        ('=')
                        ($ VSub_Name '$ehost')
                        ('\n')
                        ($ VSub_Name '$diagport')
                        ('\n')
                        ('Diag: path=')
                        ($ VSub_Number '$5')
                        ('\n')
                      ]
                    )
                  ]
                )
                (command.SimpleCommand
                  words: [{(grep)} {(-v)} {(DQ ('^') (Lit_Other '$'))} {(exp)}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})]
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [{(git)} {(fetch-pack)} {(--diag-url)} {(DQ ($ VSub_Number '$1'))}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual)})]
                )
                (C {(test_cmp)} {(expected)} {(actual)})
              ]
            )
          ]
          spids: [1323]
        )
      spids: [1318 1322]
    )
    (command.ForEach
      iter_name: r
      iter_words: [{(repo)} {(re) (Lit_Other ':') (po)} {(re/po)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ForEach
              iter_name: p
              iter_words: [{(DQ ('ssh+git'))} {(DQ ('git+ssh'))} {(git)} {(ssh)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: h
                      iter_words: [
                        {(host)}
                        {(user) (Lit_Other '@') (host)}
                        {(user) (Lit_Other '@') (Lit_Other '[') (Lit_Other ':') (Lit_Other ':') (1) 
                          (Lit_Other ']')
                        }
                        {(user) (Lit_Other '@') (Lit_Other ':') (Lit_Other ':') (1)}
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ForEach
                              iter_name: c
                              iter_words: [{(DQ )} {(Lit_Other ':')}]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (C {(test_expect_success)} 
                                      {
                                        (DQ ('fetch-pack --diag-url ') ($ VSub_Name '$p') ('://') 
                                          ($ VSub_Name '$h') ($ VSub_Name '$c') (/) ($ VSub_Name '$r')
                                        )
                                      } {(SQ <'\n'> <'\t\t\t\t\tcheck_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"\n'> <'\t\t\t\t'>)}
                                    )
                                    (C {(test_expect_success)} 
                                      {
                                        (DQ ('fetch-pack --diag-url ') ($ VSub_Name '$p') ('://') 
                                          ($ VSub_Name '$h') ($ VSub_Name '$c') ('/~') ($ VSub_Name '$r')
                                        )
                                      } {(SQ <'\n'> <'\t\t\t\t\tcheck_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"\n'> <'\t\t\t\t'>)}
                                    )
                                  ]
                                  spids: [1581 1626]
                                )
                              spids: [1574 16777215]
                            )
                          ]
                          spids: [1566 1629]
                        )
                      spids: [1544 16777215]
                    )
                    (command.ForEach
                      iter_name: h
                      iter_words: [
                        {(host)}
                        {(User) (Lit_Other '@') (host)}
                        {(User) (Lit_Other '@') (Lit_Other '[') (Lit_Other ':') (Lit_Other ':') (1) 
                          (Lit_Other ']')
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (C {(test_expect_success)} 
                              {
                                (DQ ('fetch-pack --diag-url ') ($ VSub_Name '$p') ('://') 
                                  ($ VSub_Name '$h') (':22/') ($ VSub_Name '$r')
                                )
                              } {(SQ <'\n'> <'\t\t\t\tcheck_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"\n'> <'\t\t\t'>)}
                            )
                          ]
                          spids: [1653 1674]
                        )
                      spids: [1637 16777215]
                    )
                  ]
                  spids: [1536 1677]
                )
              spids: [1522 16777215]
            )
            (command.ForEach
              iter_name: p
              iter_words: [{(file)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(test_expect_success)} 
                      {
                        (DQ ('fetch-pack --diag-url ') ($ VSub_Name '$p') ('://') ($ VSub_Name '$h') (/) 
                          ($ VSub_Name '$r')
                        )
                      } {(SQ <'\n'> <'\t\t\tcheck_prot_path $p://$h/$r $p "/$r"\n'> <'\t\t'>)}
                    )
                    (C {(test_expect_success)} 
                      {
                        (DQ ('fetch-pack --diag-url ') ($ VSub_Name '$p') ('://') ($ VSub_Name '$h') 
                          ('/~') ($ VSub_Name '$r')
                        )
                      } {(SQ <'\n'> <'\t\t\tcheck_prot_path $p://$h/~$r $p "/~$r"\n'> <'\t\t'>)}
                    )
                  ]
                  spids: [1693 1736]
                )
              spids: [1689 16777215]
            )
            (command.ForEach
              iter_name: h
              iter_words: [
                {(nohost)}
                {(nohost) (Lit_Other ':') (12)}
                {(Lit_Other '[') (Lit_Other ':') (Lit_Other ':') (1) (Lit_Other ']')}
                {(Lit_Other '[') (Lit_Other ':') (Lit_Other ':') (1) (Lit_Other ']') (Lit_Other ':') (23)}
                {(Lit_Other '[')}
                {(Lit_Other '[') (Lit_Other ':') (aa)}
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(test_expect_success)} 
                      {(DQ ('fetch-pack --diag-url ./') ($ VSub_Name '$h') (':') ($ VSub_Name '$r'))} {(SQ <'\n'> <'\t\t\tcheck_prot_path ./$h:$r $p "./$h:$r"\n'> <'\t\t'>)}
                    )
                    (C {(test_expect_success)} 
                      {
                        (DQ ('fetch-pack --diag-url ./') ($ VSub_Name '$p') (':') ($ VSub_Name '$h') 
                          ('/~') ($ VSub_Name '$r')
                        )
                      } {(SQ <'\n'> <'\t\tcheck_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"\n'> <'\t\t'>)}
                    )
                  ]
                  spids: [1776 1817]
                )
              spids: [1748 16777215]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:p spids:[1824])
                  op: Equal
                  rhs: {(ssh)}
                  spids: [1824]
                )
              ]
              spids: [1824]
            )
            (command.ForEach
              iter_name: h
              iter_words: [
                {(host)}
                {(Lit_Other '[') (Lit_Other ':') (Lit_Other ':') (1) (Lit_Other ']')}
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(test_expect_success)} 
                      {(DQ ('fetch-pack --diag-url ') ($ VSub_Name '$h') (':') ($ VSub_Name '$r'))} {(SQ <'\n'> <'\t\t\tcheck_prot_host_port_path $h:$r $p "$h" NONE "$r"\n'> <'\t\t'>)}
                    )
                    (C {(test_expect_success)} 
                      {(DQ ('fetch-pack --diag-url ') ($ VSub_Name '$h') (':/~') ($ VSub_Name '$r'))} {(SQ <'\n'> <'\t\t\tcheck_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"\n'> <'\t\t'>)}
                    )
                  ]
                  spids: [1843 1882]
                )
              spids: [1833 16777215]
            )
          ]
          spids: [1510 1884]
        )
      spids: [1501 16777215]
    )
    (C {(test_expect_success)} {(MINGW)} {(SQ <'fetch-pack --diag-url file://c:/repo'>)} 
      {(SQ <'\n'> <'\tcheck_prot_path file://c:/repo file c:/repo\n'>)}
    )
    (C {(test_expect_success)} {(MINGW)} {(SQ <'fetch-pack --diag-url c:repo'>)} 
      {(SQ <'\n'> <'\tcheck_prot_path c:repo file c:repo\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'clone shallow since ...'>)} 
      {
        (SQ <'\n'> <'\ttest_create_repo shallow-since &&\n'> <'\t(\n'> <'\tcd shallow-since &&\n'> 
          <'\tGIT_COMMITTER_DATE="100000000 +0700" git commit --allow-empty -m one &&\n'> <'\tGIT_COMMITTER_DATE="200000000 +0700" git commit --allow-empty -m two &&\n'> 
          <'\tGIT_COMMITTER_DATE="300000000 +0700" git commit --allow-empty -m three &&\n'> <'\tgit clone --shallow-since "300000000 +0700" "file://$(pwd)/." ../shallow11 &&\n'> 
          <'\tgit -C ../shallow11 log --pretty=tformat:%s HEAD >actual &&\n'> <'\techo three >expected &&\n'> <'\ttest_cmp expected actual\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch shallow since ...'>)} 
      {
        (SQ <'\n'> <'\tgit -C shallow11 fetch --shallow-since "200000000 +0700" origin &&\n'> 
          <'\tgit -C shallow11 log --pretty=tformat:%s origin/master >actual &&\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tthree\n'> <'\ttwo\n'> <'\tEOF\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'shallow clone exclude tag two'>)} 
      {
        (SQ <'\n'> <'\ttest_create_repo shallow-exclude &&\n'> <'\t(\n'> <'\tcd shallow-exclude &&\n'> 
          <'\ttest_commit one &&\n'> <'\ttest_commit two &&\n'> <'\ttest_commit three &&\n'> 
          <'\tgit clone --shallow-exclude two "file://$(pwd)/." ../shallow12 &&\n'> <'\tgit -C ../shallow12 log --pretty=tformat:%s HEAD >actual &&\n'> <'\techo three >expected &&\n'> 
          <'\ttest_cmp expected actual\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetch exclude tag one'>)} 
      {
        (SQ <'\n'> <'\tgit -C shallow12 fetch --shallow-exclude one origin &&\n'> 
          <'\tgit -C shallow12 log --pretty=tformat:%s origin/master >actual &&\n'> <'\ttest_write_lines three two >expected &&\n'> <'\ttest_cmp expected actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'fetching deepen'>)} 
      {
        (SQ <'\n'> <'\ttest_create_repo shallow-deepen &&\n'> <'\t(\n'> <'\tcd shallow-deepen &&\n'> 
          <'\ttest_commit one &&\n'> <'\ttest_commit two &&\n'> <'\ttest_commit three &&\n'> 
          <'\tgit clone --depth 1 "file://$(pwd)/." deepen &&\n'> <'\ttest_commit four &&\n'> <'\tgit -C deepen log --pretty=tformat:%s master >actual &&\n'> 
          <'\techo three >expected &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit -C deepen fetch --deepen=1 &&\n'> 
          <'\tgit -C deepen log --pretty=tformat:%s origin/master >actual &&\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tfour\n'> <'\tthree\n'> <'\ttwo\n'> <'\tEOF\n'> 
          <'\ttest_cmp expected actual\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)