(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: 'Per branch config variables affects "git fetch".\n' span_id: 9 ) (Token id:Id.Lit_Chars val:'\n' span_id:10) ) } spids: [7] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:D) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:20) command_list: (command.CommandList children:[(C {(pwd)})]) ) } spids: [19] ) ] ) (command.ShFunction name: test_bundle_object_count body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{(git)} {(verify-pack)} {(-v)} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:43) fd: -1 arg_word: {(verify.out)} ) ] ) (C {(test)} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:57) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:'^[0-9a-f]\\{40\\} ' span_id:61))} {(verify.out)} ) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] ) ] ) ) (command.ShFunction name: convert_bundle_to_pack body: (command.BraceGroup children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:84) cond: [ (command.AndOr ops: [Id.Op_DAmp] children: [(C {(read)} {(x)}) (C {(test)} {(-n)} {(DQ ($ Id.VSub_DollarName '$x'))})] ) ] body: (command.DoGroup children: [ (command.Sentence child: (C {(Id.Lit_Other ':')}) terminator: (Token id:Id.Op_Semi val:';' span_id:105) ) ] ) ) (C {(cat)}) ] ) ) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:121) (Token id:Id.Lit_Chars val:'\techo >file original &&\n' span_id:122) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:123) (Token id:Id.Lit_Chars val:'\tgit commit -a -m original' span_id:124) ) } ) (C {(test_expect_success)} {(DQ ('clone and setup child repos'))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:135) (Token id:Id.Lit_Chars val:'\tgit clone . one &&\n' span_id:136) (Token id:Id.Lit_Chars val:'\t(\n' span_id:137) (Token id:Id.Lit_Chars val:'\t\tcd one &&\n' span_id:138) (Token id:Id.Lit_Chars val:'\t\techo >file updated by one &&\n' span_id:139) (Token id:Id.Lit_Chars val:'\t\tgit commit -a -m "updated by one"\n' span_id:140) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:141) (Token id:Id.Lit_Chars val:'\tgit clone . two &&\n' span_id:142) (Token id:Id.Lit_Chars val:'\t(\n' span_id:143) (Token id:Id.Lit_Chars val:'\t\tcd two &&\n' span_id:144) (Token id:Id.Lit_Chars val:'\t\tgit config branch.master.remote one &&\n' span_id:145) (Token id: Id.Lit_Chars val: '\t\tgit config remote.one.url ../one/.git/ &&\n' span_id: 146 ) (Token id: Id.Lit_Chars val: '\t\tgit config remote.one.fetch refs/heads/master:refs/heads/one\n' span_id: 147 ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:148) (Token id:Id.Lit_Chars val:'\tgit clone . three &&\n' span_id:149) (Token id:Id.Lit_Chars val:'\t(\n' span_id:150) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:151) (Token id:Id.Lit_Chars val:'\t\tgit config branch.master.remote two &&\n' span_id:152) (Token id: Id.Lit_Chars val: '\t\tgit config branch.master.merge refs/heads/one &&\n' span_id: 153 ) (Token id:Id.Lit_Chars val:'\t\tmkdir -p .git/remotes &&\n' span_id:154) (Token id:Id.Lit_Chars val:'\t\t{\n' span_id:155) (Token id:Id.Lit_Chars val:'\t\t\techo "URL: ../two/.git/"\n' span_id:156) (Token id: Id.Lit_Chars val: '\t\t\techo "Pull: refs/heads/master:refs/heads/two"\n' span_id: 157 ) (Token id:Id.Lit_Chars val:'\t\t\techo "Pull: refs/heads/one:refs/heads/one"\n' span_id:158) (Token id:Id.Lit_Chars val:'\t\t} >.git/remotes/two\n' span_id:159) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:160) (Token id:Id.Lit_Chars val:'\tgit clone . bundle &&\n' span_id:161) (Token id:Id.Lit_Chars val:'\tgit clone . seven\n' span_id:162) ) } ) (C {(test_expect_success)} {(DQ ('fetch test'))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:173) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:174) (Token id:Id.Lit_Chars val:'\techo >file updated by origin &&\n' span_id:175) (Token id: Id.Lit_Chars val: '\tgit commit -a -m "updated by origin" &&\n' span_id: 176 ) (Token id:Id.Lit_Chars val:'\tcd two &&\n' span_id:177) (Token id:Id.Lit_Chars val:'\tgit fetch &&\n' span_id:178) (Token id:Id.Lit_Chars val:'\ttest -f .git/refs/heads/one &&\n' span_id:179) (Token id: Id.Lit_Chars val: '\tmine=$(git rev-parse refs/heads/one) &&\n' span_id: 180 ) (Token id:Id.Lit_Chars val:'\this=$(cd ../one && git rev-parse refs/heads/master) &&\n' span_id:181) (Token id:Id.Lit_Chars val:'\ttest "z$mine" = "z$his"\n' span_id:182) ) } ) (C {(test_expect_success)} {(DQ ('fetch test for-merge'))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:193) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:194) (Token id:Id.Lit_Chars val:'\tcd three &&\n' span_id:195) (Token id:Id.Lit_Chars val:'\tgit fetch &&\n' span_id:196) (Token id:Id.Lit_Chars val:'\ttest -f .git/refs/heads/two &&\n' span_id:197) (Token id:Id.Lit_Chars val:'\ttest -f .git/refs/heads/one &&\n' span_id:198) (Token id:Id.Lit_Chars val:'\tmaster_in_two=$(cd ../two && git rev-parse master) &&\n' span_id:199) (Token id: Id.Lit_Chars val: '\tone_in_two=$(cd ../two && git rev-parse one) &&\n' span_id: 200 ) (Token id:Id.Lit_Chars val:'\t{\n' span_id:201) (Token id:Id.Lit_Chars val:'\t\techo "$one_in_two\t"\n' span_id:202) (Token id:Id.Lit_Chars val:'\t\techo "$master_in_two\tnot-for-merge"\n' span_id:203) (Token id:Id.Lit_Chars val:'\t} >expected &&\n' span_id:204) (Token id:Id.Lit_Chars val:'\tcut -f -2 .git/FETCH_HEAD >actual &&\n' span_id:205) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual' span_id:206) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch --prune on its own works as expected' span_id:213))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:217) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:218) (Token id:Id.Lit_Chars val:'\tgit clone . prune &&\n' span_id:219) (Token id:Id.Lit_Chars val:'\tcd prune &&\n' span_id:220) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/extrabranch master &&\n' span_id: 221 ) (Token id:Id.Lit_Chars val:'\n' span_id:222) (Token id:Id.Lit_Chars val:'\tgit fetch --prune origin &&\n' span_id:223) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rev-parse origin/extrabranch\n' span_id:224) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch --prune with a branch name keeps branches' span_id:231))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:235) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:236) (Token id:Id.Lit_Chars val:'\tgit clone . prune-branch &&\n' span_id:237) (Token id:Id.Lit_Chars val:'\tcd prune-branch &&\n' span_id:238) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/extrabranch master &&\n' span_id: 239 ) (Token id:Id.Lit_Chars val:'\n' span_id:240) (Token id:Id.Lit_Chars val:'\tgit fetch --prune origin master &&\n' span_id:241) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/extrabranch\n' span_id:242) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch --prune with a namespace keeps other namespaces' span_id: 249 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:253) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:254) (Token id:Id.Lit_Chars val:'\tgit clone . prune-namespace &&\n' span_id:255) (Token id:Id.Lit_Chars val:'\tcd prune-namespace &&\n' span_id:256) (Token id:Id.Lit_Chars val:'\n' span_id:257) (Token id: Id.Lit_Chars val: '\tgit fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&\n' span_id: 258 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/master\n' span_id:259) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch --prune handles overlapping refspecs' span_id:266))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:270) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:271) (Token id:Id.Lit_Chars val:'\tgit update-ref refs/pull/42/head master &&\n' span_id:272) (Token id:Id.Lit_Chars val:'\tgit clone . prune-overlapping &&\n' span_id:273) (Token id:Id.Lit_Chars val:'\tcd prune-overlapping &&\n' span_id:274) (Token id: Id.Lit_Chars val: '\tgit config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&\n' span_id: 275 ) (Token id:Id.Lit_Chars val:'\n' span_id:276) (Token id:Id.Lit_Chars val:'\tgit fetch --prune origin &&\n' span_id:277) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/master &&\n' span_id:278) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/pr/42 &&\n' span_id:279) (Token id:Id.Lit_Chars val:'\n' span_id:280) (Token id: Id.Lit_Chars val: '\tgit config --unset-all remote.origin.fetch &&\n' span_id: 281 ) (Token id: Id.Lit_Chars val: '\tgit config remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&\n' span_id: 282 ) (Token id: Id.Lit_Chars val: '\tgit config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&\n' span_id: 283 ) (Token id:Id.Lit_Chars val:'\n' span_id:284) (Token id:Id.Lit_Chars val:'\tgit fetch --prune origin &&\n' span_id:285) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/master &&\n' span_id:286) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/pr/42\n' span_id:287) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch --prune --tags prunes branches but not tags' span_id: 294 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:298) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:299) (Token id:Id.Lit_Chars val:'\tgit clone . prune-tags &&\n' span_id:300) (Token id:Id.Lit_Chars val:'\tcd prune-tags &&\n' span_id:301) (Token id:Id.Lit_Chars val:'\tgit tag sometag master &&\n' span_id:302) (Token id: Id.Lit_Chars val: '\t# Create what looks like a remote-tracking branch from an earlier\n' span_id: 303 ) (Token id:Id.Lit_Chars val:'\t# fetch that has since been deleted from the remote:\n' span_id:304) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/fake-remote master &&\n' span_id: 305 ) (Token id:Id.Lit_Chars val:'\n' span_id:306) (Token id:Id.Lit_Chars val:'\tgit fetch --prune --tags origin &&\n' span_id:307) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/master &&\n' span_id:308) (Token id: Id.Lit_Chars val: '\ttest_must_fail git rev-parse origin/fake-remote &&\n' span_id: 309 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse sometag\n' span_id:310) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch --prune --tags with branch does not prune other things' span_id: 317 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:321) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:322) (Token id:Id.Lit_Chars val:'\tgit clone . prune-tags-branch &&\n' span_id:323) (Token id:Id.Lit_Chars val:'\tcd prune-tags-branch &&\n' span_id:324) (Token id:Id.Lit_Chars val:'\tgit tag sometag master &&\n' span_id:325) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/extrabranch master &&\n' span_id: 326 ) (Token id:Id.Lit_Chars val:'\n' span_id:327) (Token id: Id.Lit_Chars val: '\tgit fetch --prune --tags origin master &&\n' span_id: 328 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/extrabranch &&\n' span_id:329) (Token id:Id.Lit_Chars val:'\tgit rev-parse sometag\n' span_id:330) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch --prune --tags with refspec prunes based on refspec' span_id: 337 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:341) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:342) (Token id:Id.Lit_Chars val:'\tgit clone . prune-tags-refspec &&\n' span_id:343) (Token id:Id.Lit_Chars val:'\tcd prune-tags-refspec &&\n' span_id:344) (Token id:Id.Lit_Chars val:'\tgit tag sometag master &&\n' span_id:345) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/foo/otherbranch master &&\n' span_id: 346 ) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/remotes/origin/extrabranch master &&\n' span_id: 347 ) (Token id:Id.Lit_Chars val:'\n' span_id:348) (Token id: Id.Lit_Chars val: '\tgit fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* &&\n' span_id: 349 ) (Token id: Id.Lit_Chars val: '\ttest_must_fail git rev-parse refs/remotes/origin/foo/otherbranch &&\n' span_id: 350 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse origin/extrabranch &&\n' span_id:351) (Token id:Id.Lit_Chars val:'\tgit rev-parse sometag\n' span_id:352) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch tags when there is no tags' span_id:359))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:363) (Token id:Id.Lit_Chars val:'\n' span_id:364) (Token id:Id.Lit_Chars val:' cd "$D" &&\n' span_id:365) (Token id:Id.Lit_Chars val:'\n' span_id:366) (Token id:Id.Lit_Chars val:' mkdir notags &&\n' span_id:367) (Token id:Id.Lit_Chars val:' cd notags &&\n' span_id:368) (Token id:Id.Lit_Chars val:' git init &&\n' span_id:369) (Token id:Id.Lit_Chars val:'\n' span_id:370) (Token id:Id.Lit_Chars val:' git fetch -t ..\n' span_id:371) (Token id:Id.Lit_Chars val:'\n' span_id:372) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch following tags' span_id:379))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:383) (Token id:Id.Lit_Chars val:'\n' span_id:384) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:385) (Token id:Id.Lit_Chars val:'\tgit tag -a -m ' span_id:386) ) (annotated) (SQ (Token id:Id.Lit_Chars val:' anno HEAD &&\n' span_id:390) (Token id:Id.Lit_Chars val:'\tgit tag light HEAD &&\n' span_id:391) (Token id:Id.Lit_Chars val:'\n' span_id:392) (Token id:Id.Lit_Chars val:'\tmkdir four &&\n' span_id:393) (Token id:Id.Lit_Chars val:'\tcd four &&\n' span_id:394) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:395) (Token id:Id.Lit_Chars val:'\n' span_id:396) (Token id:Id.Lit_Chars val:'\tgit fetch .. :track &&\n' span_id:397) (Token id:Id.Lit_Chars val:'\tgit show-ref --verify refs/tags/anno &&\n' span_id:398) (Token id: Id.Lit_Chars val: '\tgit show-ref --verify refs/tags/light\n' span_id: 399 ) (Token id:Id.Lit_Chars val:'\n' span_id:400) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch uses remote ref names to describe new refs' span_id: 407 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:411) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:412) (Token id:Id.Lit_Chars val:'\tgit init descriptive &&\n' span_id:413) (Token id:Id.Lit_Chars val:'\t(\n' span_id:414) (Token id:Id.Lit_Chars val:'\t\tcd descriptive &&\n' span_id:415) (Token id:Id.Lit_Chars val:'\t\tgit config remote.o.url .. &&\n' span_id:416) (Token id: Id.Lit_Chars val: '\t\tgit config remote.o.fetch "refs/heads/*:refs/crazyheads/*" &&\n' span_id: 417 ) (Token id: Id.Lit_Chars val: '\t\tgit config --add remote.o.fetch "refs/others/*:refs/heads/*" &&\n' span_id: 418 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch o\n' span_id:419) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:420) (Token id:Id.Lit_Chars val:'\tgit tag -a -m "Descriptive tag" descriptive-tag &&\n' span_id:421) (Token id:Id.Lit_Chars val:'\tgit branch descriptive-branch &&\n' span_id:422) (Token id:Id.Lit_Chars val:'\tgit checkout descriptive-branch &&\n' span_id:423) (Token id:Id.Lit_Chars val:'\techo "Nuts" >crazy &&\n' span_id:424) (Token id:Id.Lit_Chars val:'\tgit add crazy &&\n' span_id:425) (Token id: Id.Lit_Chars val: '\tgit commit -a -m "descriptive commit" &&\n' span_id: 426 ) (Token id:Id.Lit_Chars val:'\tgit update-ref refs/others/crazy HEAD &&\n' span_id:427) (Token id:Id.Lit_Chars val:'\t(\n' span_id:428) (Token id:Id.Lit_Chars val:'\t\tcd descriptive &&\n' span_id:429) (Token id:Id.Lit_Chars val:'\t\tgit fetch o 2>actual &&\n' span_id:430) (Token id: Id.Lit_Chars val: '\t\tgrep " -> refs/crazyheads/descriptive-branch$" actual |\n' span_id: 431 ) (Token id:Id.Lit_Chars val:'\t\ttest_i18ngrep "new branch" &&\n' span_id:432) (Token id: Id.Lit_Chars val: '\t\tgrep " -> descriptive-tag$" actual |\n' span_id: 433 ) (Token id:Id.Lit_Chars val:'\t\ttest_i18ngrep "new tag" &&\n' span_id:434) (Token id:Id.Lit_Chars val:'\t\tgrep " -> crazy$" actual |\n' span_id:435) (Token id:Id.Lit_Chars val:'\t\ttest_i18ngrep "new ref"\n' span_id:436) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:437) (Token id:Id.Lit_Chars val:'\tgit checkout master\n' span_id:438) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch must not resolve short tag name' span_id:445))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:449) (Token id:Id.Lit_Chars val:'\n' span_id:450) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:451) (Token id:Id.Lit_Chars val:'\n' span_id:452) (Token id:Id.Lit_Chars val:'\tmkdir five &&\n' span_id:453) (Token id:Id.Lit_Chars val:'\tcd five &&\n' span_id:454) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:455) (Token id:Id.Lit_Chars val:'\n' span_id:456) (Token id: Id.Lit_Chars val: '\ttest_must_fail git fetch .. anno:five\n' span_id: 457 ) (Token id:Id.Lit_Chars val:'\n' span_id:458) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch can now resolve short remote name' span_id:465))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:469) (Token id:Id.Lit_Chars val:'\n' span_id:470) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:471) (Token id:Id.Lit_Chars val:'\tgit update-ref refs/remotes/six/HEAD HEAD &&\n' span_id:472) (Token id:Id.Lit_Chars val:'\n' span_id:473) (Token id:Id.Lit_Chars val:'\tmkdir six &&\n' span_id:474) (Token id:Id.Lit_Chars val:'\tcd six &&\n' span_id:475) (Token id:Id.Lit_Chars val:'\tgit init &&\n' span_id:476) (Token id:Id.Lit_Chars val:'\n' span_id:477) (Token id:Id.Lit_Chars val:'\tgit fetch .. six:six\n' span_id:478) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create bundle 1' span_id:485))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:489) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:490) (Token id:Id.Lit_Chars val:'\techo >file updated again by origin &&\n' span_id:491) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "tip" &&\n' span_id:492) (Token id:Id.Lit_Chars val:'\tgit bundle create bundle1 master^..master\n' span_id:493) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'header of bundle looks right' span_id:500))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:504) (Token id: Id.Lit_Chars val: '\thead -n 1 "$D"/bundle1 | grep "^#" &&\n' span_id: 505 ) (Token id:Id.Lit_Chars val:'\thead -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\\{40\\} " &&\n' span_id:506) (Token id: Id.Lit_Chars val: '\thead -n 3 "$D"/bundle1 | grep "^[0-9a-f]\\{40\\} " &&\n' span_id: 507 ) (Token id:Id.Lit_Chars val:'\thead -n 4 "$D"/bundle1 | grep "^$"\n' span_id:508) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create bundle 2' span_id:515))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:519) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:520) (Token id:Id.Lit_Chars val:'\tgit bundle create bundle2 master~2..master\n' span_id:521) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'unbundle 1' span_id:528))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:532) (Token id:Id.Lit_Chars val:'\tcd "$D/bundle" &&\n' span_id:533) (Token id:Id.Lit_Chars val:'\tgit checkout -b some-branch &&\n' span_id:534) (Token id: Id.Lit_Chars val: '\ttest_must_fail git fetch "$D/bundle1" master:master\n' span_id: 535 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'bundle 1 has only 3 files ' span_id:543))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:547) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:548) (Token id:Id.Lit_Chars val:'\tconvert_bundle_to_pack <bundle1 >bundle.pack &&\n' span_id:549) (Token id:Id.Lit_Chars val:'\tgit index-pack bundle.pack &&\n' span_id:550) (Token id:Id.Lit_Chars val:'\ttest_bundle_object_count bundle.pack 3\n' span_id:551) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'unbundle 2' span_id:558))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:562) (Token id:Id.Lit_Chars val:'\tcd "$D/bundle" &&\n' span_id:563) (Token id:Id.Lit_Chars val:'\tgit fetch ../bundle2 master:master &&\n' span_id:564) (Token id: Id.Lit_Chars val: '\ttest "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"\n' span_id: 565 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'bundle does not prerequisite objects' span_id:572))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:576) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:577) (Token id:Id.Lit_Chars val:'\ttouch file2 &&\n' span_id:578) (Token id:Id.Lit_Chars val:'\tgit add file2 &&\n' span_id:579) (Token id:Id.Lit_Chars val:'\tgit commit -m add.file2 file2 &&\n' span_id:580) (Token id: Id.Lit_Chars val: '\tgit bundle create bundle3 -1 HEAD &&\n' span_id: 581 ) (Token id:Id.Lit_Chars val:'\tconvert_bundle_to_pack <bundle3 >bundle.pack &&\n' span_id:582) (Token id:Id.Lit_Chars val:'\tgit index-pack bundle.pack &&\n' span_id:583) (Token id:Id.Lit_Chars val:'\ttest_bundle_object_count bundle.pack 3\n' span_id:584) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'bundle should be able to create a full history' span_id:591))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:595) (Token id:Id.Lit_Chars val:'\n' span_id:596) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:597) (Token id:Id.Lit_Chars val:'\tgit tag -a -m ' span_id:598) ) (1.0) (SQ (Token id:Id.Lit_Chars val:' v1.0 master &&\n' span_id:602) (Token id:Id.Lit_Chars val:'\tgit bundle create bundle4 v1.0\n' span_id:603) (Token id:Id.Lit_Chars val:'\n' span_id:604) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch with a non-applying branch.<name>.merge' span_id:611))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:615) (Token id: Id.Lit_Chars val: '\tgit config branch.master.remote yeti &&\n' span_id: 616 ) (Token id:Id.Lit_Chars val:'\tgit config branch.master.merge refs/heads/bigfoot &&\n' span_id:617) (Token id:Id.Lit_Chars val:'\tgit config remote.blub.url one &&\n' span_id:618) (Token id: Id.Lit_Chars val: '\tgit config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" &&\n' span_id: 619 ) (Token id:Id.Lit_Chars val:'\tgit fetch blub\n' span_id:620) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch from GIT URL with a non-applying branch.<name>.merge [1]' span_id: 630 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:634) (Token id: Id.Lit_Chars val: '\tone_head=$(cd one && git rev-parse HEAD) &&\n' span_id: 635 ) (Token id:Id.Lit_Chars val:'\tthis_head=$(git rev-parse HEAD) &&\n' span_id:636) (Token id:Id.Lit_Chars val:'\tgit update-ref -d FETCH_HEAD &&\n' span_id:637) (Token id:Id.Lit_Chars val:'\tgit fetch one &&\n' span_id:638) (Token id: Id.Lit_Chars val: '\ttest $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&\n' span_id: 639 ) (Token id:Id.Lit_Chars val:'\ttest $this_head = "$(git rev-parse --verify HEAD)"\n' span_id:640) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch from GIT URL with a non-applying branch.<name>.merge [2]' span_id: 653 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:657) (Token id: Id.Lit_Chars val: '\tone_ref=$(cd one && git symbolic-ref HEAD) &&\n' span_id: 658 ) (Token id:Id.Lit_Chars val:'\tgit config branch.master.remote blub &&\n' span_id:659) (Token id: Id.Lit_Chars val: '\tgit config branch.master.merge "$one_ref" &&\n' span_id: 660 ) (Token id:Id.Lit_Chars val:'\tgit update-ref -d FETCH_HEAD &&\n' span_id:661) (Token id:Id.Lit_Chars val:'\tgit fetch one &&\n' span_id:662) (Token id: Id.Lit_Chars val: '\ttest $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&\n' span_id: 663 ) (Token id:Id.Lit_Chars val:'\ttest $this_head = "$(git rev-parse --verify HEAD)"\n' span_id:664) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch from GIT URL with a non-applying branch.<name>.merge [3]' span_id: 677 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:681) (Token id: Id.Lit_Chars val: '\tgit config branch.master.merge "${one_ref}_not" &&\n' span_id: 682 ) (Token id:Id.Lit_Chars val:'\tgit update-ref -d FETCH_HEAD &&\n' span_id:683) (Token id:Id.Lit_Chars val:'\tgit fetch one &&\n' span_id:684) (Token id: Id.Lit_Chars val: '\ttest $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&\n' span_id: 685 ) (Token id:Id.Lit_Chars val:'\ttest $this_head = "$(git rev-parse --verify HEAD)"\n' span_id:686) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'quoting of a strangely named repo' span_id:696))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:700) (Token id:Id.Lit_Chars val:'\ttest_must_fail git fetch "a\\\\!' span_id:701) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:703)) (SQ (Token id:Id.Lit_Chars val:'b" > result 2>&1 &&\n' span_id:705) (Token id:Id.Lit_Chars val:'\tcat result &&\n' span_id:706) (Token id:Id.Lit_Chars val:'\tgrep "fatal: ' span_id:707) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:709)) (SQ (Token id:Id.Lit_Chars val:'a\\\\\\\\!' span_id:711)) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:713)) (SQ (Token id:Id.Lit_Chars val:b span_id:715)) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:717)) (SQ (Token id:Id.Lit_Chars val:'" result\n' span_id:719)) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'bundle should record HEAD correctly' span_id:726))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:730) (Token id:Id.Lit_Chars val:'\n' span_id:731) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:732) (Token id:Id.Lit_Chars val:'\tgit bundle create bundle5 HEAD master &&\n' span_id:733) (Token id: Id.Lit_Chars val: '\tgit bundle list-heads bundle5 >actual &&\n' span_id: 734 ) (Token id:Id.Lit_Chars val:'\tfor h in HEAD refs/heads/master\n' span_id:735) (Token id:Id.Lit_Chars val:'\tdo\n' span_id:736) (Token id:Id.Lit_Chars val:'\t\techo "$(git rev-parse --verify $h) $h"\n' span_id:737) (Token id:Id.Lit_Chars val:'\tdone >expect &&\n' span_id:738) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:739) (Token id:Id.Lit_Chars val:'\n' span_id:740) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'mark initial state of origin/master' span_id:747))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:751) (Token id:Id.Lit_Chars val:'\t(\n' span_id:752) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:753) (Token id: Id.Lit_Chars val: '\t\tgit tag base-origin-master refs/remotes/origin/master\n' span_id: 754 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:755) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'explicit fetch should update tracking' span_id:762))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:766) (Token id:Id.Lit_Chars val:'\n' span_id:767) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:768) (Token id:Id.Lit_Chars val:'\tgit branch -f side &&\n' span_id:769) (Token id:Id.Lit_Chars val:'\t(\n' span_id:770) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:771) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 772 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 773 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch origin master &&\n' span_id:774) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 775 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" != "$n" &&\n' span_id:776) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side\n' span_id: 777 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:778) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'explicit pull should update tracking' span_id:785))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:789) (Token id:Id.Lit_Chars val:'\n' span_id:790) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:791) (Token id:Id.Lit_Chars val:'\tgit branch -f side &&\n' span_id:792) (Token id:Id.Lit_Chars val:'\t(\n' span_id:793) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:794) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 795 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 796 ) (Token id:Id.Lit_Chars val:'\t\tgit pull origin master &&\n' span_id:797) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 798 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" != "$n" &&\n' span_id:799) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side\n' span_id: 800 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:801) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'explicit --refmap is allowed only with command-line refspec' span_id: 808 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:812) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:813) (Token id:Id.Lit_Chars val:'\t(\n' span_id:814) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:815) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git fetch --refmap="*:refs/remotes/none/*"\n' span_id: 816 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:817) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'explicit --refmap option overrides remote.*.fetch' span_id: 824 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:828) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:829) (Token id:Id.Lit_Chars val:'\tgit branch -f side &&\n' span_id:830) (Token id:Id.Lit_Chars val:'\t(\n' span_id:831) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:832) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 833 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 834 ) (Token id: Id.Lit_Chars val: '\t\tgit fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&\n' span_id: 835 ) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 836 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" = "$n" &&\n' span_id:837) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side &&\n' span_id: 838 ) (Token id:Id.Lit_Chars val:'\t\tgit rev-parse --verify refs/remotes/other/master\n' span_id:839) (Token id:Id.Lit_Chars val:'\t)\n' span_id:840) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'explicitly empty --refmap option disables remote.*.fetch' span_id: 847 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:851) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:852) (Token id:Id.Lit_Chars val:'\tgit branch -f side &&\n' span_id:853) (Token id:Id.Lit_Chars val:'\t(\n' span_id:854) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:855) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 856 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 857 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch --refmap="" origin master &&\n' span_id:858) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 859 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" = "$n" &&\n' span_id:860) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side\n' span_id: 861 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:862) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'configured fetch updates tracking' span_id:869))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:873) (Token id:Id.Lit_Chars val:'\n' span_id:874) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:875) (Token id:Id.Lit_Chars val:'\tgit branch -f side &&\n' span_id:876) (Token id:Id.Lit_Chars val:'\t(\n' span_id:877) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:878) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 879 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 880 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch origin &&\n' span_id:881) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 882 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" != "$n" &&\n' span_id:883) (Token id: Id.Lit_Chars val: '\t\tgit rev-parse --verify refs/remotes/origin/side\n' span_id: 884 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:885) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'non-matching refspecs do not confuse tracking update' span_id: 892 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:896) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:897) (Token id:Id.Lit_Chars val:'\tgit update-ref refs/odd/location HEAD &&\n' span_id:898) (Token id:Id.Lit_Chars val:'\t(\n' span_id:899) (Token id:Id.Lit_Chars val:'\t\tcd three &&\n' span_id:900) (Token id: Id.Lit_Chars val: '\t\tgit update-ref refs/remotes/origin/master base-origin-master &&\n' span_id: 901 ) (Token id:Id.Lit_Chars val:'\t\tgit config --add remote.origin.fetch \\\n' span_id:902) (Token id: Id.Lit_Chars val: '\t\t\trefs/odd/location:refs/remotes/origin/odd &&\n' span_id: 903 ) (Token id: Id.Lit_Chars val: '\t\to=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 904 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch origin master &&\n' span_id:905) (Token id: Id.Lit_Chars val: '\t\tn=$(git rev-parse --verify refs/remotes/origin/master) &&\n' span_id: 906 ) (Token id:Id.Lit_Chars val:'\t\ttest "$o" != "$n" &&\n' span_id:907) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/odd\n' span_id: 908 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:909) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'pushing nonexistent branch by mistake should not segv' span_id: 916 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:920) (Token id:Id.Lit_Chars val:'\n' span_id:921) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:922) (Token id:Id.Lit_Chars val:'\ttest_must_fail git push seven no:no\n' span_id:923) (Token id:Id.Lit_Chars val:'\n' span_id:924) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto tag following fetches minimum' span_id:931))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:935) (Token id:Id.Lit_Chars val:'\n' span_id:936) (Token id:Id.Lit_Chars val:'\tcd "$D" &&\n' span_id:937) (Token id:Id.Lit_Chars val:'\tgit clone .git follow &&\n' span_id:938) (Token id:Id.Lit_Chars val:'\tgit checkout HEAD^0 &&\n' span_id:939) (Token id:Id.Lit_Chars val:'\t(\n' span_id:940) (Token id:Id.Lit_Chars val:'\t\tfor i in 1 2 3 4 5 6 7\n' span_id:941) (Token id:Id.Lit_Chars val:'\t\tdo\n' span_id:942) (Token id:Id.Lit_Chars val:'\t\t\techo $i >>file &&\n' span_id:943) (Token id:Id.Lit_Chars val:'\t\t\tgit commit -m $i -a &&\n' span_id:944) (Token id: Id.Lit_Chars val: '\t\t\tgit tag -a -m $i excess-$i || exit 1\n' span_id: 945 ) (Token id:Id.Lit_Chars val:'\t\tdone\n' span_id:946) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:947) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:948) (Token id:Id.Lit_Chars val:'\t(\n' span_id:949) (Token id:Id.Lit_Chars val:'\t\tcd follow &&\n' span_id:950) (Token id:Id.Lit_Chars val:'\t\tgit fetch\n' span_id:951) (Token id:Id.Lit_Chars val:'\t)\n' span_id:952) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'refuse to fetch into the current branch' span_id:959))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:963) (Token id:Id.Lit_Chars val:'\n' span_id:964) (Token id: Id.Lit_Chars val: '\ttest_must_fail git fetch . side:master\n' span_id: 965 ) (Token id:Id.Lit_Chars val:'\n' span_id:966) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'fetch into the current branch with --update-head-ok' span_id: 973 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:977) (Token id:Id.Lit_Chars val:'\n' span_id:978) (Token id: Id.Lit_Chars val: '\tgit fetch --update-head-ok . side:master\n' span_id: 979 ) (Token id:Id.Lit_Chars val:'\n' span_id:980) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch --dry-run' span_id:987))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:991) (Token id:Id.Lit_Chars val:'\n' span_id:992) (Token id:Id.Lit_Chars val:'\trm -f .git/FETCH_HEAD &&\n' span_id:993) (Token id:Id.Lit_Chars val:'\tgit fetch --dry-run . &&\n' span_id:994) (Token id:Id.Lit_Chars val:'\t! test -f .git/FETCH_HEAD\n' span_id:995) ) } ) (C {(test_expect_success)} {(DQ ('should be able to fetch with duplicate refspecs'))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1006) (Token id:Id.Lit_Chars val:'\tmkdir dups &&\n' span_id:1007) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1008) (Token id:Id.Lit_Chars val:'\t\tcd dups &&\n' span_id:1009) (Token id:Id.Lit_Chars val:'\t\tgit init &&\n' span_id:1010) (Token id: Id.Lit_Chars val: '\t\tgit config branch.master.remote three &&\n' span_id: 1011 ) (Token id:Id.Lit_Chars val:'\t\tgit config remote.three.url ../three/.git &&\n' span_id:1012) (Token id: Id.Lit_Chars val: '\t\tgit config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&\n' span_id: 1013 ) (Token id: Id.Lit_Chars val: '\t\tgit config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&\n' span_id: 1014 ) (Token id:Id.Lit_Chars val:'\t\tgit fetch three\n' span_id:1015) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1016) ) } ) (command.ShFunction name: set_config_tristate body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_Number '$2'))} arms: [ (case_arm pat_list: [{(unset)}] action: [(C {(test_unconfig)} {(DQ ($ Id.VSub_Number '$1'))})] spids: [1045 1046 1054 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (C {(git)} {(config)} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))}) ] spids: [1057 1058 1072 -1] ) ] ) ] ) ) (command.ShFunction name: test_configured_prune body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fetch_prune) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1088] ) (assign_pair lhs: (sh_lhs_expr.Name name:remote_origin_prune) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [1091] ) (assign_pair lhs: (sh_lhs_expr.Name name:cmdline) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [1094] ) (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: {($ Id.VSub_Number '$4')} spids: [1097] ) ] ) (C {(test_expect_success)} { (DQ ('prune fetch.prune=') ($ Id.VSub_Number '$1') (' remote.origin.prune=') ($ Id.VSub_Number '$2') (braced_var_sub token: (Token id:Id.VSub_Number val:3 span_id:1110) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {(' ') ($ Id.VSub_Number '$3')} ) ) ('; ') ($ Id.VSub_Number '$4') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1120) (Token id: Id.Lit_Chars val: '\t\t# make sure a newbranch is there in . and also in one\n' span_id: 1121 ) (Token id:Id.Lit_Chars val:'\t\tgit branch -f newbranch &&\n' span_id:1122) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:1123) (Token id:Id.Lit_Chars val:'\t\t\tcd one &&\n' span_id:1124) (Token id: Id.Lit_Chars val: '\t\t\ttest_unconfig fetch.prune &&\n' span_id: 1125 ) (Token id:Id.Lit_Chars val:'\t\t\ttest_unconfig remote.origin.prune &&\n' span_id:1126) (Token id:Id.Lit_Chars val:'\t\t\tgit fetch &&\n' span_id:1127) (Token id: Id.Lit_Chars val: '\t\t\tgit rev-parse --verify refs/remotes/origin/newbranch\n' span_id: 1128 ) (Token id:Id.Lit_Chars val:'\t\t) &&\n' span_id:1129) (Token id:Id.Lit_Chars val:'\n' span_id:1130) (Token id:Id.Lit_Chars val:'\t\t# now remove it\n' span_id:1131) (Token id:Id.Lit_Chars val:'\t\tgit branch -d newbranch &&\n' span_id:1132) (Token id:Id.Lit_Chars val:'\n' span_id:1133) (Token id:Id.Lit_Chars val:'\t\t# then test\n' span_id:1134) (Token id:Id.Lit_Chars val:'\t\t(\n' span_id:1135) (Token id:Id.Lit_Chars val:'\t\t\tcd one &&\n' span_id:1136) (Token id: Id.Lit_Chars val: '\t\t\tset_config_tristate fetch.prune $fetch_prune &&\n' span_id: 1137 ) (Token id: Id.Lit_Chars val: '\t\t\tset_config_tristate remote.origin.prune $remote_origin_prune &&\n' span_id: 1138 ) (Token id:Id.Lit_Chars val:'\n' span_id:1139) (Token id: Id.Lit_Chars val: '\t\t\tgit fetch $cmdline &&\n' span_id: 1140 ) (Token id:Id.Lit_Chars val:'\t\t\tcase "$expected" in\n' span_id:1141) (Token id:Id.Lit_Chars val:'\t\t\tpruned)\n' span_id:1142) (Token id: Id.Lit_Chars val: '\t\t\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/newbranch\n' span_id: 1143 ) (Token id:Id.Lit_Chars val:'\t\t\t\t;;\n' span_id:1144) (Token id:Id.Lit_Chars val:'\t\t\tkept)\n' span_id:1145) (Token id: Id.Lit_Chars val: '\t\t\t\tgit rev-parse --verify refs/remotes/origin/newbranch\n' span_id: 1146 ) (Token id:Id.Lit_Chars val:'\t\t\t\t;;\n' span_id:1147) (Token id:Id.Lit_Chars val:'\t\t\tesac\n' span_id:1148) (Token id:Id.Lit_Chars val:'\t\t)\n' span_id:1149) (Token id:Id.Lit_Chars val:'\t' span_id:1150) ) } ) ] ) ) (C {(test_configured_prune)} {(unset)} {(unset)} {(DQ )} {(kept)}) (C {(test_configured_prune)} {(unset)} {(unset)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(unset)} {(unset)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(false)} {(unset)} {(DQ )} {(kept)}) (C {(test_configured_prune)} {(false)} {(unset)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(false)} {(unset)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(unset)} {(DQ )} {(pruned)}) (C {(test_configured_prune)} {(true)} {(unset)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(unset)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(unset)} {(false)} {(DQ )} {(kept)}) (C {(test_configured_prune)} {(unset)} {(false)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(unset)} {(false)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(false)} {(false)} {(DQ )} {(kept)}) (C {(test_configured_prune)} {(false)} {(false)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(false)} {(false)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(false)} {(DQ )} {(kept)}) (C {(test_configured_prune)} {(true)} {(false)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(false)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(unset)} {(true)} {(DQ )} {(pruned)}) (C {(test_configured_prune)} {(unset)} {(true)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(unset)} {(true)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(false)} {(true)} {(DQ )} {(pruned)}) (C {(test_configured_prune)} {(false)} {(true)} {(DQ (--no-prune))} {(kept)}) (C {(test_configured_prune)} {(false)} {(true)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(true)} {(DQ )} {(pruned)}) (C {(test_configured_prune)} {(true)} {(true)} {(DQ (--prune))} {(pruned)}) (C {(test_configured_prune)} {(true)} {(true)} {(DQ (--no-prune))} {(kept)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'all boundary commits are excluded' span_id:1483))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1487) (Token id:Id.Lit_Chars val:'\ttest_commit base &&\n' span_id:1488) (Token id:Id.Lit_Chars val:'\ttest_commit oneside &&\n' span_id:1489) (Token id:Id.Lit_Chars val:'\tgit checkout HEAD^ &&\n' span_id:1490) (Token id:Id.Lit_Chars val:'\ttest_commit otherside &&\n' span_id:1491) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1492) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1493) (Token id:Id.Lit_Chars val:'\tgit merge otherside &&\n' span_id:1494) (Token id:Id.Lit_Chars val:'\tad=$(git log --no-walk --format=%ad HEAD) &&\n' span_id:1495) (Token id: Id.Lit_Chars val: '\tgit bundle create twoside-boundary.bdl master --since="$ad" &&\n' span_id: 1496 ) (Token id: Id.Lit_Chars val: '\tconvert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&\n' span_id: 1497 ) (Token id: Id.Lit_Chars val: '\tpack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&\n' span_id: 1498 ) (Token id: Id.Lit_Chars val: '\ttest_bundle_object_count .git/objects/pack/pack-${pack##pack\t}.pack 3\n' span_id: 1499 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetch --prune prints the remotes url' span_id:1506))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1510) (Token id:Id.Lit_Chars val:'\tgit branch goodbye &&\n' span_id:1511) (Token id:Id.Lit_Chars val:'\tgit clone . only-prunes &&\n' span_id:1512) (Token id:Id.Lit_Chars val:'\tgit branch -D goodbye &&\n' span_id:1513) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1514) (Token id:Id.Lit_Chars val:'\t\tcd only-prunes &&\n' span_id:1515) (Token id:Id.Lit_Chars val:'\t\tgit fetch --prune origin 2>&1 | head -n1 >../actual\n' span_id:1516) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1517) (Token id:Id.Lit_Chars val:'\techo "From ${D}/." >expect &&\n' span_id:1518) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:1519) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'branchname D/F conflict resolved by --prune' span_id:1526))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1530) (Token id:Id.Lit_Chars val:'\tgit branch dir/file &&\n' span_id:1531) (Token id:Id.Lit_Chars val:'\tgit clone . prune-df-conflict &&\n' span_id:1532) (Token id:Id.Lit_Chars val:'\tgit branch -D dir/file &&\n' span_id:1533) (Token id:Id.Lit_Chars val:'\tgit branch dir &&\n' span_id:1534) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1535) (Token id:Id.Lit_Chars val:'\t\tcd prune-df-conflict &&\n' span_id:1536) (Token id:Id.Lit_Chars val:'\t\tgit fetch --prune &&\n' span_id:1537) (Token id:Id.Lit_Chars val:'\t\tgit rev-parse origin/dir >../actual\n' span_id:1538) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1539) (Token id:Id.Lit_Chars val:'\tgit rev-parse dir >expect &&\n' span_id:1540) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1541) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetching a one-level ref works' span_id:1548))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1552) (Token id:Id.Lit_Chars val:'\ttest_commit extra &&\n' span_id:1553) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:1554) (Token id:Id.Lit_Chars val:'\tgit update-ref refs/foo extra &&\n' span_id:1555) (Token id:Id.Lit_Chars val:'\tgit init one-level &&\n' span_id:1556) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1557) (Token id:Id.Lit_Chars val:'\t\tcd one-level &&\n' span_id:1558) (Token id:Id.Lit_Chars val:'\t\tgit fetch .. HEAD refs/foo\n' span_id:1559) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1560) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fetching with auto-gc does not lock up' span_id:1567))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1571) (Token id:Id.Lit_Chars val:'\twrite_script askyesno <<-\\EOF &&\n' span_id:1572) (Token id:Id.Lit_Chars val:'\techo "$*" &&\n' span_id:1573) (Token id:Id.Lit_Chars val:'\tfalse\n' span_id:1574) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1575) (Token id:Id.Lit_Chars val:'\tgit clone "file://$D" auto-gc &&\n' span_id:1576) (Token id:Id.Lit_Chars val:'\ttest_commit test2 &&\n' span_id:1577) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1578) (Token id:Id.Lit_Chars val:'\t\tcd auto-gc &&\n' span_id:1579) (Token id:Id.Lit_Chars val:'\t\tgit config gc.autoPackLimit 1 &&\n' span_id:1580) (Token id:Id.Lit_Chars val:'\t\tgit config gc.autoDetach false &&\n' span_id:1581) (Token id: Id.Lit_Chars val: '\t\tGIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&\n' span_id: 1582 ) (Token id:Id.Lit_Chars val:'\t\t! grep "Should I try again" fetch.out\n' span_id:1583) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1584) ) } ) (C {(test_expect_success)} {(C_LOCALE_OUTPUT)} {(SQ (Token id:Id.Lit_Chars val:'fetch aligned output' span_id:1593))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1597) (Token id:Id.Lit_Chars val:'\tgit clone . full-output &&\n' span_id:1598) (Token id:Id.Lit_Chars val:'\ttest_commit looooooooooooong-tag &&\n' span_id:1599) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1600) (Token id:Id.Lit_Chars val:'\t\tcd full-output &&\n' span_id:1601) (Token id: Id.Lit_Chars val: '\t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n' span_id: 1602 ) (Token id:Id.Lit_Chars val:'\t\t\tgrep -e "->" | cut -c 22- >../actual\n' span_id:1603) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1604) (Token id:Id.Lit_Chars val:'\tcat >expect <<-\\EOF &&\n' span_id:1605) (Token id: Id.Lit_Chars val: '\tmaster -> origin/master\n' span_id: 1606 ) (Token id:Id.Lit_Chars val:'\tlooooooooooooong-tag -> looooooooooooong-tag\n' span_id:1607) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1608) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1609) ) } ) (C {(test_expect_success)} {(C_LOCALE_OUTPUT)} {(SQ (Token id:Id.Lit_Chars val:'fetch compact output' span_id:1618))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1622) (Token id:Id.Lit_Chars val:'\tgit clone . compact &&\n' span_id:1623) (Token id:Id.Lit_Chars val:'\ttest_commit extraaa &&\n' span_id:1624) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1625) (Token id:Id.Lit_Chars val:'\t\tcd compact &&\n' span_id:1626) (Token id: Id.Lit_Chars val: '\t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n' span_id: 1627 ) (Token id:Id.Lit_Chars val:'\t\t\tgrep -e "->" | cut -c 22- >../actual\n' span_id:1628) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1629) (Token id:Id.Lit_Chars val:'\tcat >expect <<-\\EOF &&\n' span_id:1630) (Token id:Id.Lit_Chars val:'\tmaster -> origin/*\n' span_id:1631) (Token id:Id.Lit_Chars val:'\textraaa -> *\n' span_id:1632) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1633) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1634) ) } ) (C {(test_done)}) ] )