(List
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('test_description', {[SQ <LIT_CHARS "Per branch config variables affects \"git fetch\".\n"> <LIT_CHARS "\n">]})])
  (Com {[LIT_CHARS .]} {[LIT_CHARS ./test-lib.sh]}  )
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('D', {[ComSub (Com {[LIT_CHARS pwd]})]})])
  (FunctionDef test_bundle_object_count []
    (AndOr OP_AND_IF
      (Com {[LIT_CHARS git]} {[LIT_CHARS verify-pack]} {[LIT_CHARS -v]} {[DQ [VarSub 1]]}
        <
        (FilenameRedirectNode filename={[LIT_CHARS verify.out]} <REDIR_GREAT ">"> 1),
        >
      )
      (Com {[LIT_CHARS test]} {[DQ [VarSub 2]]} {[LIT_DBRACKET_LIKE "="]} {[ComSub (Pipeline (Com {[LIT_CHARS grep]} {[SQ <LIT_CHARS "^[0-9a-f]\\{40\\} ">]} {[LIT_CHARS verify.out]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]}      )
    )
  )
  (FunctionDef convert_bundle_to_pack []
    (List
      (While
        (AndOr OP_AND_IF
          (Com {[LIT_CHARS read]} {[LIT_CHARS x]}          )
          (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub x]]}          )
        )
        (Com {[LIT_OTHER ":"]}        )
      )
      (Com {[LIT_CHARS cat]}      )
    )
  )
  (Com {[LIT_CHARS test_expect_success]} {[LIT_CHARS setup]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\techo >file original &&\n"> <LIT_CHARS "\tgit add file &&\n"> <LIT_CHARS "\tgit commit -a -m original">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[DQ [LIT_CHARS "clone and setup child repos"]]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit clone . one &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd one &&\n"> <LIT_CHARS "\t\techo >file updated by one &&\n"> <LIT_CHARS "\t\tgit commit -a -m \"updated by one\"\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit clone . two &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd two &&\n"> <LIT_CHARS "\t\tgit config branch.master.remote one &&\n"> <LIT_CHARS "\t\tgit config remote.one.url ../one/.git/ &&\n"> <LIT_CHARS "\t\tgit config remote.one.fetch refs/heads/master:refs/heads/one\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit clone . three &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd three &&\n"> <LIT_CHARS "\t\tgit config branch.master.remote two &&\n"> <LIT_CHARS "\t\tgit config branch.master.merge refs/heads/one &&\n"> <LIT_CHARS "\t\tmkdir -p .git/remotes &&\n"> <LIT_CHARS "\t\t{\n"> <LIT_CHARS "\t\t\techo \"URL: ../two/.git/\"\n"> <LIT_CHARS "\t\t\techo \"Pull: refs/heads/master:refs/heads/two\"\n"> <LIT_CHARS "\t\t\techo \"Pull: refs/heads/one:refs/heads/one\"\n"> <LIT_CHARS "\t\t} >.git/remotes/two\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit clone . bundle &&\n"> <LIT_CHARS "\tgit clone . seven\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[DQ [LIT_CHARS "fetch test"]]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\techo >file updated by origin &&\n"> <LIT_CHARS "\tgit commit -a -m \"updated by origin\" &&\n"> <LIT_CHARS "\tcd two &&\n"> <LIT_CHARS "\tgit fetch &&\n"> <LIT_CHARS "\ttest -f .git/refs/heads/one &&\n"> <LIT_CHARS "\tmine=`git rev-parse refs/heads/one` &&\n"> <LIT_CHARS "\this=`cd ../one && git rev-parse refs/heads/master` &&\n"> <LIT_CHARS "\ttest \"z$mine\" = \"z$his\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[DQ [LIT_CHARS "fetch test for-merge"]]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tcd three &&\n"> <LIT_CHARS "\tgit fetch &&\n"> <LIT_CHARS "\ttest -f .git/refs/heads/two &&\n"> <LIT_CHARS "\ttest -f .git/refs/heads/one &&\n"> <LIT_CHARS "\tmaster_in_two=`cd ../two && git rev-parse master` &&\n"> <LIT_CHARS "\tone_in_two=`cd ../two && git rev-parse one` &&\n"> <LIT_CHARS "\t{\n"> <LIT_CHARS "\t\techo \"$one_in_two\t\"\n"> <LIT_CHARS "\t\techo \"$master_in_two\tnot-for-merge\"\n"> <LIT_CHARS "\t} >expected &&\n"> <LIT_CHARS "\tcut -f -2 .git/FETCH_HEAD >actual &&\n"> <LIT_CHARS "\ttest_cmp expected actual">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --prune on its own works as expected">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone . prune &&\n"> <LIT_CHARS "\tcd prune &&\n"> <LIT_CHARS "\tgit fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --prune origin &&\n"> <LIT_CHARS "\ttest_must_fail git rev-parse origin/extrabranch\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --prune with a branch name keeps branches">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone . prune-branch &&\n"> <LIT_CHARS "\tcd prune-branch &&\n"> <LIT_CHARS "\tgit fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --prune origin master &&\n"> <LIT_CHARS "\tgit rev-parse origin/extrabranch\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --prune with a namespace keeps other namespaces">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone . prune-namespace &&\n"> <LIT_CHARS "\tcd prune-namespace &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&\n"> <LIT_CHARS "\tgit rev-parse origin/master\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --prune --tags does not delete the remote-tracking branches">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone . prune-tags &&\n"> <LIT_CHARS "\tcd prune-tags &&\n"> <LIT_CHARS "\tgit fetch origin refs/heads/master:refs/tags/sometag &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --prune --tags origin &&\n"> <LIT_CHARS "\tgit rev-parse origin/master &&\n"> <LIT_CHARS "\ttest_must_fail git rev-parse somebranch\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --prune --tags with branch does not delete other remote-tracking branches">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone . prune-tags-branch &&\n"> <LIT_CHARS "\tcd prune-tags-branch &&\n"> <LIT_CHARS "\tgit fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --prune --tags origin master &&\n"> <LIT_CHARS "\tgit rev-parse origin/extrabranch\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch tags when there is no tags">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "    cd \"$D\" &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "    mkdir notags &&\n"> <LIT_CHARS "    cd notags &&\n"> <LIT_CHARS "    git init &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "    git fetch -t ..\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch following tags">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit tag -a -m ">] [LIT_CHARS annotated] [SQ <LIT_CHARS " anno HEAD &&\n"> <LIT_CHARS "\tgit tag light HEAD &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir four &&\n"> <LIT_CHARS "\tcd four &&\n"> <LIT_CHARS "\tgit init &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch .. :track &&\n"> <LIT_CHARS "\tgit show-ref --verify refs/tags/anno &&\n"> <LIT_CHARS "\tgit show-ref --verify refs/tags/light\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch uses remote ref names to describe new refs">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit init descriptive &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd descriptive &&\n"> <LIT_CHARS "\t\tgit config remote.o.url .. &&\n"> <LIT_CHARS "\t\tgit config remote.o.fetch \"refs/heads/*:refs/crazyheads/*\" &&\n"> <LIT_CHARS "\t\tgit config --add remote.o.fetch \"refs/others/*:refs/heads/*\" &&\n"> <LIT_CHARS "\t\tgit fetch o\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit tag -a -m \"Descriptive tag\" descriptive-tag &&\n"> <LIT_CHARS "\tgit branch descriptive-branch &&\n"> <LIT_CHARS "\tgit checkout descriptive-branch &&\n"> <LIT_CHARS "\techo \"Nuts\" >crazy &&\n"> <LIT_CHARS "\tgit add crazy &&\n"> <LIT_CHARS "\tgit commit -a -m \"descriptive commit\" &&\n"> <LIT_CHARS "\tgit update-ref refs/others/crazy HEAD &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd descriptive &&\n"> <LIT_CHARS "\t\tgit fetch o 2>actual &&\n"> <LIT_CHARS "\t\tgrep \" -> refs/crazyheads/descriptive-branch$\" actual |\n"> <LIT_CHARS "\t\ttest_i18ngrep \"new branch\" &&\n"> <LIT_CHARS "\t\tgrep \" -> descriptive-tag$\" actual |\n"> <LIT_CHARS "\t\ttest_i18ngrep \"new tag\" &&\n"> <LIT_CHARS "\t\tgrep \" -> crazy$\" actual |\n"> <LIT_CHARS "\t\ttest_i18ngrep \"new ref\"\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit checkout master\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch must not resolve short tag name">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir five &&\n"> <LIT_CHARS "\tcd five &&\n"> <LIT_CHARS "\tgit init &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\ttest_must_fail git fetch .. anno:five\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch can now resolve short remote name">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit update-ref refs/remotes/six/HEAD HEAD &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir six &&\n"> <LIT_CHARS "\tcd six &&\n"> <LIT_CHARS "\tgit init &&\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch .. six:six\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "create bundle 1">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\techo >file updated again by origin &&\n"> <LIT_CHARS "\tgit commit -a -m \"tip\" &&\n"> <LIT_CHARS "\tgit bundle create bundle1 master^..master\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "header of bundle looks right">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\thead -n 1 \"$D\"/bundle1 | grep \"^#\" &&\n"> <LIT_CHARS "\thead -n 2 \"$D\"/bundle1 | grep \"^-[0-9a-f]\\{40\\} \" &&\n"> <LIT_CHARS "\thead -n 3 \"$D\"/bundle1 | grep \"^[0-9a-f]\\{40\\} \" &&\n"> <LIT_CHARS "\thead -n 4 \"$D\"/bundle1 | grep \"^$\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "create bundle 2">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit bundle create bundle2 master~2..master\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "unbundle 1">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D/bundle\" &&\n"> <LIT_CHARS "\tgit checkout -b some-branch &&\n"> <LIT_CHARS "\ttest_must_fail git fetch \"$D/bundle1\" master:master\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "bundle 1 has only 3 files ">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tconvert_bundle_to_pack <bundle1 >bundle.pack &&\n"> <LIT_CHARS "\tgit index-pack bundle.pack &&\n"> <LIT_CHARS "\ttest_bundle_object_count bundle.pack 3\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "unbundle 2">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D/bundle\" &&\n"> <LIT_CHARS "\tgit fetch ../bundle2 master:master &&\n"> <LIT_CHARS "\ttest \"tip\" = \"$(git log -1 --pretty=oneline master | cut -b42-)\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "bundle does not prerequisite objects">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\ttouch file2 &&\n"> <LIT_CHARS "\tgit add file2 &&\n"> <LIT_CHARS "\tgit commit -m add.file2 file2 &&\n"> <LIT_CHARS "\tgit bundle create bundle3 -1 HEAD &&\n"> <LIT_CHARS "\tconvert_bundle_to_pack <bundle3 >bundle.pack &&\n"> <LIT_CHARS "\tgit index-pack bundle.pack &&\n"> <LIT_CHARS "\ttest_bundle_object_count bundle.pack 3\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "bundle should be able to create a full history">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit tag -a -m ">] [LIT_CHARS 1.0] [SQ <LIT_CHARS " v1.0 master &&\n"> <LIT_CHARS "\tgit bundle create bundle4 v1.0\n"> <LIT_CHARS "\n">]}  )
  (AndOr OP_AND_IF
    (Pipeline!
      (Com {[LIT_CHARS rsync]} {[LIT_CHARS --help]}
        <
        (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} <REDIR_GREAT ">"> 1),
        (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} <REDIR_GREAT "2>"> 2),
        >
      )
    )
    (AndOr OP_OR_IF
      (Com {[LIT_CHARS say]} {[SQ <LIT_CHARS "Skipping rsync tests because rsync was not found">]}      )
      (List
        (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch via rsync">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit pack-refs &&\n"> <LIT_CHARS "\tmkdir rsynced &&\n"> <LIT_CHARS "\t(cd rsynced &&\n"> <LIT_CHARS "\t git init --bare &&\n"> <LIT_CHARS "\t git fetch \"rsync:$(pwd)/../.git\" master:refs/heads/master &&\n"> <LIT_CHARS "\t git gc --prune &&\n"> <LIT_CHARS "\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n"> <LIT_CHARS "\t git fsck --full)\n">]}        )
        (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "push via rsync">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir rsynced2 &&\n"> <LIT_CHARS "\t(cd rsynced2 &&\n"> <LIT_CHARS "\t git init) &&\n"> <LIT_CHARS "\t(cd rsynced &&\n"> <LIT_CHARS "\t git push \"rsync:$(pwd)/../rsynced2/.git\" master) &&\n"> <LIT_CHARS "\t(cd rsynced2 &&\n"> <LIT_CHARS "\t git gc --prune &&\n"> <LIT_CHARS "\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n"> <LIT_CHARS "\t git fsck --full)\n">]}        )
        (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "push via rsync">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir rsynced3 &&\n"> <LIT_CHARS "\t(cd rsynced3 &&\n"> <LIT_CHARS "\t git init) &&\n"> <LIT_CHARS "\tgit push --all \"rsync:$(pwd)/rsynced3/.git\" &&\n"> <LIT_CHARS "\t(cd rsynced3 &&\n"> <LIT_CHARS "\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n"> <LIT_CHARS "\t git fsck --full)\n">]}        )
      )
    )
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch with a non-applying branch.<name>.merge">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit config branch.master.remote yeti &&\n"> <LIT_CHARS "\tgit config branch.master.merge refs/heads/bigfoot &&\n"> <LIT_CHARS "\tgit config remote.blub.url one &&\n"> <LIT_CHARS "\tgit config remote.blub.fetch \"refs/heads/*:refs/remotes/one/*\" &&\n"> <LIT_CHARS "\tgit fetch blub\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch from GIT URL with a non-applying branch.<name>.merge [1]">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tone_head=$(cd one && git rev-parse HEAD) &&\n"> <LIT_CHARS "\tthis_head=$(git rev-parse HEAD) &&\n"> <LIT_CHARS "\tgit update-ref -d FETCH_HEAD &&\n"> <LIT_CHARS "\tgit fetch one &&\n"> <LIT_CHARS "\ttest $one_head = \"$(git rev-parse --verify FETCH_HEAD)\" &&\n"> <LIT_CHARS "\ttest $this_head = \"$(git rev-parse --verify HEAD)\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch from GIT URL with a non-applying branch.<name>.merge [2]">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tone_ref=$(cd one && git symbolic-ref HEAD) &&\n"> <LIT_CHARS "\tgit config branch.master.remote blub &&\n"> <LIT_CHARS "\tgit config branch.master.merge \"$one_ref\" &&\n"> <LIT_CHARS "\tgit update-ref -d FETCH_HEAD &&\n"> <LIT_CHARS "\tgit fetch one &&\n"> <LIT_CHARS "\ttest $one_head = \"$(git rev-parse --verify FETCH_HEAD)\" &&\n"> <LIT_CHARS "\ttest $this_head = \"$(git rev-parse --verify HEAD)\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch from GIT URL with a non-applying branch.<name>.merge [3]">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit config branch.master.merge \"${one_ref}_not\" &&\n"> <LIT_CHARS "\tgit update-ref -d FETCH_HEAD &&\n"> <LIT_CHARS "\tgit fetch one &&\n"> <LIT_CHARS "\ttest $one_head = \"$(git rev-parse --verify FETCH_HEAD)\" &&\n"> <LIT_CHARS "\ttest $this_head = \"$(git rev-parse --verify HEAD)\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "quoting of a strangely named repo">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_must_fail git fetch \"a\\\\!">] [\ LIT_ESCAPED_CHAR "\\'"] [SQ <LIT_CHARS "b\" > result 2>&1 &&\n"> <LIT_CHARS "\tcat result &&\n"> <LIT_CHARS "\tgrep \"fatal: ">] [\ LIT_ESCAPED_CHAR "\\'"] [SQ <LIT_CHARS "a\\\\\\\\!">] [\ LIT_ESCAPED_CHAR "\\'"] [SQ <LIT_CHARS b>] [\ LIT_ESCAPED_CHAR "\\'"] [SQ <LIT_CHARS "\" result\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "bundle should record HEAD correctly">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit bundle create bundle5 HEAD master &&\n"> <LIT_CHARS "\tgit bundle list-heads bundle5 >actual &&\n"> <LIT_CHARS "\tfor h in HEAD refs/heads/master\n"> <LIT_CHARS "\tdo\n"> <LIT_CHARS "\t\techo \"$(git rev-parse --verify $h) $h\"\n"> <LIT_CHARS "\tdone >expect &&\n"> <LIT_CHARS "\ttest_cmp expect actual\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "explicit fetch should not update tracking">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit branch -f side &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd three &&\n"> <LIT_CHARS "\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\tgit fetch origin master &&\n"> <LIT_CHARS "\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\ttest \"$o\" = \"$n\" &&\n"> <LIT_CHARS "\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side\n"> <LIT_CHARS "\t)\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "explicit pull should not update tracking">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit branch -f side &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd three &&\n"> <LIT_CHARS "\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\tgit pull origin master &&\n"> <LIT_CHARS "\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\ttest \"$o\" = \"$n\" &&\n"> <LIT_CHARS "\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side\n"> <LIT_CHARS "\t)\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "configured fetch updates tracking">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit branch -f side &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd three &&\n"> <LIT_CHARS "\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\tgit fetch origin &&\n"> <LIT_CHARS "\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n"> <LIT_CHARS "\t\ttest \"$o\" != \"$n\" &&\n"> <LIT_CHARS "\t\tgit rev-parse --verify refs/remotes/origin/side\n"> <LIT_CHARS "\t)\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "pushing nonexistent branch by mistake should not segv">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\ttest_must_fail git push seven no:no\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto tag following fetches minimum">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tcd \"$D\" &&\n"> <LIT_CHARS "\tgit clone .git follow &&\n"> <LIT_CHARS "\tgit checkout HEAD^0 &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tfor i in 1 2 3 4 5 6 7\n"> <LIT_CHARS "\t\tdo\n"> <LIT_CHARS "\t\t\techo $i >>file &&\n"> <LIT_CHARS "\t\t\tgit commit -m $i -a &&\n"> <LIT_CHARS "\t\t\tgit tag -a -m $i excess-$i || exit 1\n"> <LIT_CHARS "\t\tdone\n"> <LIT_CHARS "\t) &&\n"> <LIT_CHARS "\tgit checkout master &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd follow &&\n"> <LIT_CHARS "\t\tgit fetch\n"> <LIT_CHARS "\t)\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "refuse to fetch into the current branch">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\ttest_must_fail git fetch . side:master\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch into the current branch with --update-head-ok">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\tgit fetch --update-head-ok . side:master\n"> <LIT_CHARS "\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fetch --dry-run">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\n"> <LIT_CHARS "\trm -f .git/FETCH_HEAD &&\n"> <LIT_CHARS "\tgit fetch --dry-run . &&\n"> <LIT_CHARS "\t! test -f .git/FETCH_HEAD\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[DQ [LIT_CHARS "should be able to fetch with duplicate refspecs"]]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tmkdir dups &&\n"> <LIT_CHARS "\t(\n"> <LIT_CHARS "\t\tcd dups &&\n"> <LIT_CHARS "\t\tgit init &&\n"> <LIT_CHARS "\t\tgit config branch.master.remote three &&\n"> <LIT_CHARS "\t\tgit config remote.three.url ../three/.git &&\n"> <LIT_CHARS "\t\tgit config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&\n"> <LIT_CHARS "\t\tgit config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&\n"> <LIT_CHARS "\t\tgit fetch three\n"> <LIT_CHARS "\t)\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "all boundary commits are excluded">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_commit base &&\n"> <LIT_CHARS "\ttest_commit oneside &&\n"> <LIT_CHARS "\tgit checkout HEAD^ &&\n"> <LIT_CHARS "\ttest_commit otherside &&\n"> <LIT_CHARS "\tgit checkout master &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit merge otherside &&\n"> <LIT_CHARS "\tad=$(git log --no-walk --format=%ad HEAD) &&\n"> <LIT_CHARS "\tgit bundle create twoside-boundary.bdl master --since=\"$ad\" &&\n"> <LIT_CHARS "\tconvert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&\n"> <LIT_CHARS "\tpack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&\n"> <LIT_CHARS "\ttest_bundle_object_count .git/objects/pack/pack-${pack##pack\t}.pack 3\n">]}  )
  (Com {[LIT_CHARS test_done]}  )
)