(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: 'test dumb fetching over http via static file'
                  span_id: 6
                )
              )
            }
          spids: [4]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/lib-httpd.sh)})
    (C {(start_httpd)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup repository' span_id:26))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:30) 
          (Token id:Id.Lit_Chars val:'\tgit config push.default matching &&\n' span_id:31) (Token id:Id.Lit_Chars val:'\techo content1 >file &&\n' span_id:32) 
          (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\tgit commit -m one &&\n' span_id:34) 
          (Token id:Id.Lit_Chars val:'\techo content2 >file &&\n' span_id:35) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:36) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m two\n' span_id:37)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'create http-accessible bare repository with loose objects'
            span_id: 44
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:48) 
          (Token
            id: Id.Lit_Chars
            val: '\tcp -R .git "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&\n'
            span_id: 49
          ) (Token id:Id.Lit_Chars val:'\t(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&\n' span_id:50) 
          (Token id:Id.Lit_Chars val:'\t git config core.bare true &&\n' span_id:51) (Token id:Id.Lit_Chars val:'\t mkdir -p hooks &&\n' span_id:52) 
          (Token
            id: Id.Lit_Chars
            val: '\t echo "exec git update-server-info" >hooks/post-update &&\n'
            span_id: 53
          ) (Token id:Id.Lit_Chars val:'\t chmod +x hooks/post-update &&\n' span_id:54) 
          (Token id:Id.Lit_Chars val:'\t hooks/post-update\n' span_id:55) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:56) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&\n'
            span_id: 57
          ) (Token id:Id.Lit_Chars val:'\tgit push public master:master\n' span_id:58)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'clone http repository' span_id:65))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:69) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone $HTTPD_URL/dumb/repo.git clone-tmpl &&\n'
            span_id: 70
          ) (Token id:Id.Lit_Chars val:'\tcp -R clone-tmpl clone &&\n' span_id:71) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp file clone/file\n' span_id:72)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'create password-protected repository' span_id:79))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:83) 
          (Token
            id: Id.Lit_Chars
            val: '\tmkdir -p "$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/" &&\n'
            span_id: 84
          ) (Token id:Id.Lit_Chars val:'\tcp -Rf "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \\\n' span_id:85) 
          (Token
            id: Id.Lit_Chars
            val: '\t       "$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/repo.git"\n'
            span_id: 86
          )
        )
      }
    )
    (C {(setup_askpass_helper)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'cloning password-protected repository can fail' span_id:96))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:100) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong &&\n' span_id:101) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-fail &&\n'
            span_id: 102
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass both wrong\n' span_id:103)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http auth can use user/pass in URL' span_id:110))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:114) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong &&\n' span_id:115) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL_USER_PASS/auth/dumb/repo.git" clone-auth-none &&\n'
            span_id: 116
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass none\n' span_id:117)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http auth can use just user in URL' span_id:124))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:128) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:129) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL_USER/auth/dumb/repo.git" clone-auth-pass &&\n'
            span_id: 130
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:131)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http auth can request both user and pass' span_id:138))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:142) 
          (Token id:Id.Lit_Chars val:'\tset_askpass user@host pass@host &&\n' span_id:143) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-both &&\n'
            span_id: 144
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass both user@host\n' span_id:145)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http auth respects credential helper config' span_id:152))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:156) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config_global credential.helper "!f() {\n'
            span_id: 157
          ) (Token id:Id.Lit_Chars val:'\t\tcat >/dev/null\n' span_id:158) 
          (Token id:Id.Lit_Chars val:'\t\techo username=user@host\n' span_id:159) (Token id:Id.Lit_Chars val:'\t\techo password=pass@host\n' span_id:160) 
          (Token id:Id.Lit_Chars val:'\t}; f" &&\n' span_id:161) (Token id:Id.Lit_Chars val:'\tset_askpass wrong &&\n' span_id:162) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-helper &&\n'
            span_id: 163
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass none\n' span_id:164)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http auth can get username from config' span_id:171))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:175) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config_global "credential.$HTTPD_URL.username" user@host &&\n'
            span_id: 176
          ) (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:177) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-user &&\n'
            span_id: 178
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:179)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'configured username does not override URL' span_id:186))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:190) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config_global "credential.$HTTPD_URL.username" wrong &&\n'
            span_id: 191
          ) (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:192) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone "$HTTPD_URL_USER/auth/dumb/repo.git" clone-auth-user2 &&\n'
            span_id: 193
          ) (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:194)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'set up repo with http submodules' span_id:201))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:205) 
          (Token id:Id.Lit_Chars val:'\tgit init super &&\n' span_id:206) (Token id:Id.Lit_Chars val:'\tset_askpass user@host pass@host &&\n' span_id:207) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:208) (Token id:Id.Lit_Chars val:'\t\tcd super &&\n' span_id:209) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit submodule add "$HTTPD_URL/auth/dumb/repo.git" sub &&\n'
            span_id: 210
          ) (Token id:Id.Lit_Chars val:'\t\tgit commit -m "add submodule"\n' span_id:211) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:212)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'cmdline credential config passes to submodule via clone'
            span_id: 219
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:223) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:224) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone --recursive super super-clone &&\n'
            span_id: 225
          ) (Token id:Id.Lit_Chars val:'\trm -rf super-clone &&\n' span_id:226) 
          (Token id:Id.Lit_Chars val:'\n' span_id:227) (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:228) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit -c "credential.$HTTPD_URL.username=user@host" \\\n'
            span_id: 229
          ) (Token id:Id.Lit_Chars val:'\t\tclone --recursive super super-clone &&\n' span_id:230) 
          (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:231)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'cmdline credential config passes submodule via fetch'
            span_id: 238
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:242) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:243) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git -C super-clone fetch --recurse-submodules &&\n'
            span_id: 244
          ) (Token id:Id.Lit_Chars val:'\n' span_id:245) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:246) (Token id:Id.Lit_Chars val:'\tgit -C super-clone \\\n' span_id:247) 
          (Token
            id: Id.Lit_Chars
            val: '\t    -c "credential.$HTTPD_URL.username=user@host" \\\n'
            span_id: 248
          ) (Token id:Id.Lit_Chars val:'\t    fetch --recurse-submodules &&\n' span_id:249) 
          (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:250)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'cmdline credential config passes submodule update'
            span_id: 257
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:261) 
          (Token
            id: Id.Lit_Chars
            val: '\t# advance the submodule HEAD so that a fetch is required\n'
            span_id: 262
          ) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -m foo &&\n' span_id:263) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push "$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/repo.git" HEAD &&\n'
            span_id: 264
          ) (Token id:Id.Lit_Chars val:'\tsha1=$(git rev-parse HEAD) &&\n' span_id:265) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit -C super-clone update-index --cacheinfo 160000,$sha1,sub &&\n'
            span_id: 266
          ) (Token id:Id.Lit_Chars val:'\n' span_id:267) 
          (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:268) (Token id:Id.Lit_Chars val:'\ttest_must_fail git -C super-clone submodule update &&\n' span_id:269) 
          (Token id:Id.Lit_Chars val:'\n' span_id:270) (Token id:Id.Lit_Chars val:'\tset_askpass wrong pass@host &&\n' span_id:271) 
          (Token id:Id.Lit_Chars val:'\tgit -C super-clone \\\n' span_id:272) (Token id:Id.Lit_Chars val:'\t    -c "credential.$HTTPD_URL.username=user@host" \\\n' span_id:273) 
          (Token id:Id.Lit_Chars val:'\t    submodule update &&\n' span_id:274) (Token id:Id.Lit_Chars val:'\texpect_askpass pass user@host\n' span_id:275)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch changes via http' span_id:282))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:286) 
          (Token id:Id.Lit_Chars val:'\techo content >>file &&\n' span_id:287) (Token id:Id.Lit_Chars val:'\tgit commit -a -m two &&\n' span_id:288) 
          (Token id:Id.Lit_Chars val:'\tgit push public &&\n' span_id:289) (Token id:Id.Lit_Chars val:'\t(cd clone && git pull) &&\n' span_id:290) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp file clone/file\n' span_id:291)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch changes via manual http-fetch' span_id:298))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:302) 
          (Token id:Id.Lit_Chars val:'\tcp -R clone-tmpl clone2 &&\n' span_id:303) (Token id:Id.Lit_Chars val:'\n' span_id:304) 
          (Token
            id: Id.Lit_Chars
            val: '\tHEAD=$(git rev-parse --verify HEAD) &&\n'
            span_id: 305
          ) (Token id:Id.Lit_Chars val:'\t(cd clone2 &&\n' span_id:306) 
          (Token
            id: Id.Lit_Chars
            val: 
'\t git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) &&\n'
            span_id: 307
          ) (Token id:Id.Lit_Chars val:'\t git checkout master-new &&\n' span_id:308) 
          (Token
            id: Id.Lit_Chars
            val: '\t test $HEAD = $(git rev-parse --verify HEAD)) &&\n'
            span_id: 309
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp file clone2/file\n' span_id:310)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http remote detects correct HEAD' span_id:317))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:321) 
          (Token id:Id.Lit_Chars val:'\tgit push public master:other &&\n' span_id:322) (Token id:Id.Lit_Chars val:'\t(cd clone &&\n' span_id:323) 
          (Token id:Id.Lit_Chars val:'\t git remote set-head origin -d &&\n' span_id:324) (Token id:Id.Lit_Chars val:'\t git remote set-head origin -a &&\n' span_id:325) 
          (Token
            id: Id.Lit_Chars
            val: '\t git symbolic-ref refs/remotes/origin/HEAD > output &&\n'
            span_id: 326
          ) (Token id:Id.Lit_Chars val:'\t echo refs/remotes/origin/master > expect &&\n' span_id:327) 
          (Token id:Id.Lit_Chars val:'\t test_cmp expect output\n' span_id:328) (Token id:Id.Lit_Chars val:'\t)\n' span_id:329)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch packed objects' span_id:336))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:340) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tcp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git &&\n'
            span_id: 341
          ) (Token id:Id.Lit_Chars val:'\t(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git &&\n' span_id:342) 
          (Token id:Id.Lit_Chars val:'\t git --bare repack -a -d\n' span_id:343) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:344) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit clone $HTTPD_URL/dumb/repo_pack.git\n'
            span_id: 345
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch notices corrupt pack' span_id:352))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:356) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tcp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&\n'
            span_id: 357
          ) (Token id:Id.Lit_Chars val:'\t(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&\n' span_id:358) 
          (Token
            id: Id.Lit_Chars
            val: '\t p=$(ls objects/pack/pack-*.pack) &&\n'
            span_id: 359
          ) (Token id:Id.Lit_Chars val:'\t chmod u+w $p &&\n' span_id:360) 
          (Token
            id: Id.Lit_Chars
            val: '\t printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc\n'
            span_id: 361
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:362) 
          (Token id:Id.Lit_Chars val:'\tmkdir repo_bad1.git &&\n' span_id:363) (Token id:Id.Lit_Chars val:'\t(cd repo_bad1.git &&\n' span_id:364) 
          (Token id:Id.Lit_Chars val:'\t git --bare init &&\n' span_id:365) 
          (Token
            id: Id.Lit_Chars
            val: '\t test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad1.git &&\n'
            span_id: 366
          ) (Token id:Id.Lit_Chars val:'\t test 0 = $(ls objects/pack/pack-*.pack | wc -l)\n' span_id:367) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:368)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch notices corrupt idx' span_id:375))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:379) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tcp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&\n'
            span_id: 380
          ) (Token id:Id.Lit_Chars val:'\t(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&\n' span_id:381) 
          (Token id:Id.Lit_Chars val:'\t p=$(ls objects/pack/pack-*.idx) &&\n' span_id:382) (Token id:Id.Lit_Chars val:'\t chmod u+w $p &&\n' span_id:383) 
          (Token
            id: Id.Lit_Chars
            val: '\t printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc\n'
            span_id: 384
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:385) 
          (Token id:Id.Lit_Chars val:'\tmkdir repo_bad2.git &&\n' span_id:386) (Token id:Id.Lit_Chars val:'\t(cd repo_bad2.git &&\n' span_id:387) 
          (Token id:Id.Lit_Chars val:'\t git --bare init &&\n' span_id:388) 
          (Token
            id: Id.Lit_Chars
            val: '\t test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad2.git &&\n'
            span_id: 389
          ) (Token id:Id.Lit_Chars val:'\t test 0 = $(ls objects/pack | wc -l)\n' span_id:390) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:391)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'fetch can handle previously-fetched .idx files' span_id:398))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:402) 
          (Token id:Id.Lit_Chars val:'\tgit checkout --orphan branch1 &&\n' span_id:403) (Token id:Id.Lit_Chars val:'\techo base >file &&\n' span_id:404) 
          (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:405) (Token id:Id.Lit_Chars val:'\tgit commit -m base &&\n' span_id:406) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit --bare init "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git &&\n'
            span_id: 407
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch1 &&\n'
            span_id: 408
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d &&\n'
            span_id: 409
          ) (Token id:Id.Lit_Chars val:'\tgit checkout -b branch2 branch1 &&\n' span_id:410) 
          (Token id:Id.Lit_Chars val:'\techo b2 >>file &&\n' span_id:411) (Token id:Id.Lit_Chars val:'\tgit commit -a -m b2 &&\n' span_id:412) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch2 &&\n'
            span_id: 413
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d &&\n'
            span_id: 414
          ) (Token id:Id.Lit_Chars val:'\tgit --bare init clone_packed_branches.git &&\n' span_id:415) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch1:branch1 &&\n'
            span_id: 416
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tgit --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch2:branch2\n'
            span_id: 417
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'did not use upload-pack service' span_id:424))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:428) 
          (Token id:Id.Lit_Chars val:'\ttest_might_fail grep ' span_id:429)
        ) (/git-upload-pack) 
        (SQ (Token id:Id.Lit_Chars val:' <"$HTTPD_ROOT_PATH"/access.log >act &&\n' span_id:433) 
          (Token id:Id.Lit_Chars val:'\t: >exp &&\n' span_id:434) (Token id:Id.Lit_Chars val:'\ttest_cmp exp act\n' span_id:435)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git client shows text/plain errors' span_id:442))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:446) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/error/text" 2>stderr &&\n'
            span_id: 447
          ) (Token id:Id.Lit_Chars val:'\tgrep "this is the error message" stderr\n' span_id:448)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git client does not show html errors' span_id:455))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:459) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/error/html" 2>stderr &&\n'
            span_id: 460
          ) (Token id:Id.Lit_Chars val:'\t! grep "this is the error message" stderr\n' span_id:461)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git client shows text/plain with a charset' span_id:468))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:472) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/error/charset" 2>stderr &&\n'
            span_id: 473
          ) (Token id:Id.Lit_Chars val:'\tgrep "this is the error message" stderr\n' span_id:474)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'http error messages are reencoded' span_id:481))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:485) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/error/utf16" 2>stderr &&\n'
            span_id: 486
          ) (Token id:Id.Lit_Chars val:'\tgrep "this is the error message" stderr\n' span_id:487)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'reencoding is robust to whitespace oddities' span_id:494))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:498) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git clone "$HTTPD_URL/error/odd-spacing" 2>stderr &&\n'
            span_id: 499
          ) (Token id:Id.Lit_Chars val:'\tgrep "this is the error message" stderr\n' span_id:500)
        )
      }
    )
    (command.ShFunction
      name: check_language
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.Case
                  to_match: {(DQ ($ Id.VSub_Number '$2'))}
                  arms: [
                    (case_arm
                      pat_list: [{(SQ )}]
                      action: [
                        (command.Simple
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_Great val:'>' span_id:526)
                              fd: -1
                              arg_word: {(expect)}
                            )
                          ]
                        )
                      ]
                      spids: [521 523 530 -1]
                    )
                    (case_arm
                      pat_list: [{(Id.Lit_QMark '?') (Id.Lit_Star '*')}]
                      action: [
                        (command.Simple
                          words: [
                            {(echo)}
                            {(DQ ('=> Send header: Accept-Language: ') ($ Id.VSub_Number '$1'))}
                          ]
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_Great val:'>' span_id:545)
                              fd: -1
                              arg_word: {(expect)}
                            )
                          ]
                        )
                      ]
                      spids: [533 535 549 -1]
                    )
                  ]
                )
                (command.Simple
                  words: [
                    {(git)}
                    {(ls-remote)}
                    {(DQ ($ Id.VSub_DollarName '$HTTPD_URL') (/dumb/repo.git))}
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:576)
                      fd: -1
                      arg_word: {(output)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:579)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                  more_env: [
                    (env_pair name:GIT_TRACE_CURL val:{(true)} spids:[557])
                    (env_pair
                      name: LANGUAGE
                      val: {($ Id.VSub_Number '$2')}
                      spids: [562]
                    )
                  ]
                )
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [{(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\015' span_id:590))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:593)
                          fd: -1
                          arg_word: {(output)}
                        )
                      ]
                    )
                    (C {(sort)} {(-u)})
                    (command.Simple
                      words: [
                        {(sed)}
                        {(-ne)}
                        {
                          (SQ 
                            (Token
                              id: Id.Lit_Chars
                              val: '/^=> Send header: Accept-Language:/ p'
                              span_id: 611
                            )
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:614)
                          fd: -1
                          arg_word: {(actual)}
                        )
                      ]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(expect)} {(actual)})
              ]
            )
          ]
        )
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git client sends Accept-Language based on LANGUAGE'
            span_id: 632
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:636) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, *;q=0.9" ko_KR.UTF-8'
            span_id: 637
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git client sends Accept-Language correctly with unordinary LANGUAGE'
            span_id: 644
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:648) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, *;q=0.9" "ko_KR:" &&\n'
            span_id: 649
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, en-US;q=0.9, *;q=0.8" "ko_KR::en_US" &&\n'
            span_id: 650
          ) (Token id:Id.Lit_Chars val:'\tcheck_language "ko-KR, *;q=0.9" ":::ko_KR" &&\n' span_id:651) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, en-US;q=0.9, *;q=0.8" "ko_KR!!:en_US" &&\n'
            span_id: 652
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, ja-JP;q=0.9, *;q=0.8" "ko_KR en_US:ja_JP"'
            span_id: 653
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git client sends Accept-Language with many preferred languages'
            span_id: 660
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:664) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, en-US;q=0.9, fr-CA;q=0.8, de;q=0.7, sr;q=0.6, \\\n'
            span_id: 665
          ) (Token id:Id.Lit_Chars val:'ja;q=0.5, zh;q=0.4, sv;q=0.3, pt;q=0.2, *;q=0.1" \\\n' span_id:666) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tko_KR.EUC-KR:en_US.UTF-8:fr_CA:de.UTF-8@euro:sr@latin:ja:zh:sv:pt &&\n'
            span_id: 667
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tcheck_language "ko-KR, en-US;q=0.99, fr-CA;q=0.98, de;q=0.97, sr;q=0.96, \\\n'
            span_id: 668
          ) 
          (Token
            id: Id.Lit_Chars
            val: 'ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90" \\\n'
            span_id: 669
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tko_KR.EUC-KR:en_US.UTF-8:fr_CA:de.UTF-8@euro:sr@latin:ja:zh:sv:pt:nb\n'
            span_id: 670
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'git client does not send an empty Accept-Language'
            span_id: 677
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:681) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tGIT_TRACE_CURL=true LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&\n'
            span_id: 682
          ) (Token id:Id.Lit_Chars val:'\t! grep "^=> Send header: Accept-Language:" stderr\n' span_id:683)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'remote-http complains cleanly about malformed urls'
            span_id: 690
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:694) 
          (Token
            id: Id.Lit_Chars
            val: '\t# do not actually issue "list" or other commands, as we do not\n'
            span_id: 695
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t# want to rely on what curl would actually do with such a broken\n'
            span_id: 696
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t# URL. This is just about making sure we do not segfault during\n'
            span_id: 697
          ) (Token id:Id.Lit_Chars val:'\t# initialization.\n' span_id:698) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git remote-http http::/example.com/repo.git\n'
            span_id: 699
          )
        )
      }
    )
    (C {(stop_httpd)})
    (C {(test_done)})
  ]
)