(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:'remote tracking stats' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: advance body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:29) fd: -1 arg_word: {(DQ ($ Id.VSub_Number '$1'))} ) ] ) (C {(git)} {(add)} {(DQ ($ Id.VSub_Number '$1'))}) (C {(test_tick)}) (C {(git)} {(commit)} {(-m)} {(DQ ($ Id.VSub_Number '$1'))}) ] ) ] ) ) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:71) (Token id:Id.Lit_Chars val:'\tadvance a &&\n' span_id:72) (Token id:Id.Lit_Chars val:'\tadvance b &&\n' span_id:73) (Token id:Id.Lit_Chars val:'\tadvance c &&\n' span_id:74) (Token id:Id.Lit_Chars val:'\tgit clone . test &&\n' span_id:75) (Token id:Id.Lit_Chars val:'\t(\n' span_id:76) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:77) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b1 origin &&\n' span_id:78) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard HEAD^ &&\n' span_id:79) (Token id:Id.Lit_Chars val:'\t\tadvance d &&\n' span_id:80) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b2 origin &&\n' span_id:81) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard b1 &&\n' span_id:82) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b3 origin &&\n' span_id:83) (Token id:Id.Lit_Chars val:'\t\tgit reset --hard HEAD^ &&\n' span_id:84) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b4 origin &&\n' span_id:85) (Token id:Id.Lit_Chars val:'\t\tadvance e &&\n' span_id:86) (Token id:Id.Lit_Chars val:'\t\tadvance f &&\n' span_id:87) (Token id: Id.Lit_Chars val: '\t\tgit checkout -b brokenbase origin &&\n' span_id: 88 ) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b5 --track brokenbase &&\n' span_id:89) (Token id:Id.Lit_Chars val:'\t\tadvance g &&\n' span_id:90) (Token id:Id.Lit_Chars val:'\t\tgit branch -d brokenbase &&\n' span_id:91) (Token id:Id.Lit_Chars val:'\t\tgit checkout -b b6 origin\n' span_id:92) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:93) (Token id: Id.Lit_Chars val: '\tgit checkout -b follower --track master &&\n' span_id: 94 ) (Token id:Id.Lit_Chars val:'\tadvance h\n' span_id:95) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:script) op: assign_op.Equal rhs: { (SQ (Token id: Id.Lit_Chars val: 's/^..\\(b.\\) *[0-9a-f]* \\(.*\\)$/\\1 \\2/p' span_id: 101 ) ) } spids: [99] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:106) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:109) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:110)) (OF) } here_end_span_id: 119 stdin_parts: [ ('b1 [ahead 1, behind 1] d\n') ('b2 [ahead 1, behind 1] d\n') ('b3 [behind 1] b\n') ('b4 [ahead 2] f\n') ('b5 g\n') ('b6 c\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'branch -v' span_id:124))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:128) (Token id:Id.Lit_Chars val:'\t(\n' span_id:129) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:130) (Token id:Id.Lit_Chars val:'\t\tgit branch -v\n' span_id:131) (Token id:Id.Lit_Chars val:'\t) |\n' span_id:132) (Token id:Id.Lit_Chars val:'\tsed -n -e "$script" >actual &&\n' span_id:133) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:134) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:140) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:143) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:144)) (OF) } here_end_span_id: 153 stdin_parts: [ ('b1 [origin/master: ahead 1, behind 1] d\n') ('b2 [origin/master: ahead 1, behind 1] d\n') ('b3 [origin/master: behind 1] b\n') ('b4 [origin/master: ahead 2] f\n') ('b5 [brokenbase: gone] g\n') ('b6 [origin/master] c\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'branch -vv' span_id:158))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:162) (Token id:Id.Lit_Chars val:'\t(\n' span_id:163) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:164) (Token id:Id.Lit_Chars val:'\t\tgit branch -vv\n' span_id:165) (Token id:Id.Lit_Chars val:'\t) |\n' span_id:166) (Token id:Id.Lit_Chars val:'\tsed -n -e "$script" >actual &&\n' span_id:167) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:168) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checkout (diverged from upstream)' span_id:175))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:179) (Token id:Id.Lit_Chars val:'\t(\n' span_id:180) (Token id:Id.Lit_Chars val:'\t\tcd test && git checkout b1\n' span_id:181) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:182) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "have 1 and 1 different" actual\n' span_id:183) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checkout with local tracked branch' span_id:190))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:194) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:195) (Token id:Id.Lit_Chars val:'\tgit checkout follower >actual &&\n' span_id:196) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "is ahead of" actual\n' span_id:197) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checkout (upstream is gone)' span_id:204))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:208) (Token id:Id.Lit_Chars val:'\t(\n' span_id:209) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:210) (Token id:Id.Lit_Chars val:'\t\tgit checkout b5\n' span_id:211) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:212) (Token id: Id.Lit_Chars val: '\ttest_i18ngrep "is based on .*, but the upstream is gone." actual\n' span_id: 213 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'checkout (up-to-date with upstream)' span_id:220))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:224) (Token id:Id.Lit_Chars val:'\t(\n' span_id:225) (Token id:Id.Lit_Chars val:'\t\tcd test && git checkout b6\n' span_id:226) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:227) (Token id: Id.Lit_Chars val: '\ttest_i18ngrep "Your branch is up-to-date with .origin/master" actual\n' span_id: 228 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status (diverged from upstream)' span_id:235))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:239) (Token id:Id.Lit_Chars val:'\t(\n' span_id:240) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:241) (Token id:Id.Lit_Chars val:'\t\tgit checkout b1 >/dev/null &&\n' span_id:242) (Token id:Id.Lit_Chars val:'\t\t# reports nothing to commit\n' span_id:243) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git commit --dry-run\n' span_id: 244 ) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:245) (Token id: Id.Lit_Chars val: '\ttest_i18ngrep "have 1 and 1 different" actual\n' span_id: 246 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status (upstream is gone)' span_id:253))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:257) (Token id:Id.Lit_Chars val:'\t(\n' span_id:258) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:259) (Token id:Id.Lit_Chars val:'\t\tgit checkout b5 >/dev/null &&\n' span_id:260) (Token id:Id.Lit_Chars val:'\t\t# reports nothing to commit\n' span_id:261) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git commit --dry-run\n' span_id: 262 ) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:263) (Token id: Id.Lit_Chars val: '\ttest_i18ngrep "is based on .*, but the upstream is gone." actual\n' span_id: 264 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status (up-to-date with upstream)' span_id:271))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:275) (Token id:Id.Lit_Chars val:'\t(\n' span_id:276) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:277) (Token id:Id.Lit_Chars val:'\t\tgit checkout b6 >/dev/null &&\n' span_id:278) (Token id:Id.Lit_Chars val:'\t\t# reports nothing to commit\n' span_id:279) (Token id: Id.Lit_Chars val: '\t\ttest_must_fail git commit --dry-run\n' span_id: 280 ) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:281) (Token id: Id.Lit_Chars val: '\ttest_i18ngrep "Your branch is up-to-date with .origin/master" actual\n' span_id: 282 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:288) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:291) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:292)) (OF) } here_end_span_id: 296 stdin_parts: [('## b1...origin/master [ahead 1, behind 1]\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status -s -b (diverged from upstream)' span_id:301))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:305) (Token id:Id.Lit_Chars val:'\t(\n' span_id:306) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:307) (Token id:Id.Lit_Chars val:'\t\tgit checkout b1 >/dev/null &&\n' span_id:308) (Token id:Id.Lit_Chars val:'\t\tgit status -s -b | head -1\n' span_id:309) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:310) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:311) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:317) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:320) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:321)) (OF) } here_end_span_id: 325 stdin_parts: [('## b5...brokenbase [gone]\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status -s -b (upstream is gone)' span_id:330))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:334) (Token id:Id.Lit_Chars val:'\t(\n' span_id:335) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:336) (Token id:Id.Lit_Chars val:'\t\tgit checkout b5 >/dev/null &&\n' span_id:337) (Token id:Id.Lit_Chars val:'\t\tgit status -s -b | head -1\n' span_id:338) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:339) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:340) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:346) fd: -1 arg_word: {(expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:349) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:350)) (OF) } here_end_span_id: 354 stdin_parts: [('## b6...origin/master\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'status -s -b (up-to-date with upstream)' span_id:359))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:363) (Token id:Id.Lit_Chars val:'\t(\n' span_id:364) (Token id:Id.Lit_Chars val:'\t\tcd test &&\n' span_id:365) (Token id:Id.Lit_Chars val:'\t\tgit checkout b6 >/dev/null &&\n' span_id:366) (Token id:Id.Lit_Chars val:'\t\tgit status -s -b | head -1\n' span_id:367) (Token id:Id.Lit_Chars val:'\t) >actual &&\n' span_id:368) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:369) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fail to track lightweight tags' span_id:376))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:380) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:381) (Token id:Id.Lit_Chars val:'\tgit tag light &&\n' span_id:382) (Token id: Id.Lit_Chars val: '\ttest_must_fail git branch --track lighttrack light >actual &&\n' span_id: 383 ) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep ! "set up to track" actual &&\n' span_id:384) (Token id: Id.Lit_Chars val: '\ttest_must_fail git checkout lighttrack\n' span_id: 385 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fail to track annotated tags' span_id:392))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:396) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:397) (Token id:Id.Lit_Chars val:'\tgit tag -m heavy heavy &&\n' span_id:398) (Token id: Id.Lit_Chars val: '\ttest_must_fail git branch --track heavytrack heavy >actual &&\n' span_id: 399 ) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep ! "set up to track" actual &&\n' span_id:400) (Token id: Id.Lit_Chars val: '\ttest_must_fail git checkout heavytrack\n' span_id: 401 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'setup tracking with branch --set-upstream on existing branch' span_id: 408 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:412) (Token id:Id.Lit_Chars val:'\tgit branch from-master master &&\n' span_id:413) (Token id: Id.Lit_Chars val: '\ttest_must_fail git config branch.from-master.merge > actual &&\n' span_id: 414 ) (Token id:Id.Lit_Chars val:'\tgit branch --set-upstream from-master master &&\n' span_id:415) (Token id: Id.Lit_Chars val: '\tgit config branch.from-master.merge > actual &&\n' span_id: 416 ) (Token id:Id.Lit_Chars val:'\tgrep -q "^refs/heads/master$" actual\n' span_id:417) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--set-upstream does not change branch' span_id:424))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:428) (Token id:Id.Lit_Chars val:'\tgit branch from-master2 master &&\n' span_id:429) (Token id: Id.Lit_Chars val: '\ttest_must_fail git config branch.from-master2.merge > actual &&\n' span_id: 430 ) (Token id:Id.Lit_Chars val:'\tgit rev-list from-master2 &&\n' span_id:431) (Token id: Id.Lit_Chars val: '\tgit update-ref refs/heads/from-master2 from-master2^ &&\n' span_id: 432 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse from-master2 >expect2 &&\n' span_id:433) (Token id: Id.Lit_Chars val: '\tgit branch --set-upstream from-master2 master &&\n' span_id: 434 ) (Token id:Id.Lit_Chars val:'\tgit config branch.from-master.merge > actual &&\n' span_id:435) (Token id: Id.Lit_Chars val: '\tgit rev-parse from-master2 >actual2 &&\n' span_id: 436 ) (Token id:Id.Lit_Chars val:'\tgrep -q "^refs/heads/master$" actual &&\n' span_id:437) (Token id:Id.Lit_Chars val:'\tcmp expect2 actual2\n' span_id:438) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--set-upstream @{-1}' span_id:445))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:449) (Token id:Id.Lit_Chars val:'\tgit checkout from-master &&\n' span_id:450) (Token id:Id.Lit_Chars val:'\tgit checkout from-master2 &&\n' span_id:451) (Token id: Id.Lit_Chars val: '\tgit config branch.from-master2.merge > expect2 &&\n' span_id: 452 ) (Token id:Id.Lit_Chars val:'\tgit branch --set-upstream @{-1} follower &&\n' span_id:453) (Token id: Id.Lit_Chars val: '\tgit config branch.from-master.merge > actual &&\n' span_id: 454 ) (Token id:Id.Lit_Chars val:'\tgit config branch.from-master2.merge > actual2 &&\n' span_id:455) (Token id: Id.Lit_Chars val: '\tgit branch --set-upstream from-master follower &&\n' span_id: 456 ) (Token id:Id.Lit_Chars val:'\tgit config branch.from-master.merge > expect &&\n' span_id:457) (Token id:Id.Lit_Chars val:'\ttest_cmp expect2 actual2 &&\n' span_id:458) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:459) ) } ) (C {(test_done)}) ] )