(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:'A simple turial in the form of a test case' span_id:15))} spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:blob span_id:27))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:31) (Token id:Id.Lit_Chars val:'\techo "Hello World" > hello &&\n' span_id:32) (Token id:Id.Lit_Chars val:'\techo "Silly example" > example &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\n' span_id:34) (Token id:Id.Lit_Chars val:'\tgit update-index --add hello example &&\n' span_id:35) (Token id:Id.Lit_Chars val:'\n' span_id:36) (Token id:Id.Lit_Chars val:'\ttest blob = "$(git cat-file -t 557db03)"\n' span_id:37) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'blob 557db03' span_id:44))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:48) (Token id: Id.Lit_Chars val: '\ttest "Hello World" = "$(git cat-file blob 557db03)"\n' span_id: 49 ) ) } ) (command.Simple words: [{(echo)} {(DQ ("It's a new day for git"))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:59) fd: -1 arg_word: {(hello)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:64) fd: -1 arg_word: {(diff.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:68) fd: -1 here_begin: {(EOF)} here_end_span_id: 80 stdin_parts: [ ('diff --git a/hello b/hello\n') ('index 557db03..263414f 100644\n') ('--- a/hello\n') ('+++ b/hello\n') ('@@ -1 +1,2 @@\n') (' Hello World\n') ("+It's a new day for git\n") ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git diff-files -p' span_id:85))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:89) (Token id:Id.Lit_Chars val:'\tgit diff-files -p > diff.output &&\n' span_id:90) (Token id:Id.Lit_Chars val:'\ttest_cmp diff.expect diff.output\n' span_id:91) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git diff' span_id:98))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:102) (Token id:Id.Lit_Chars val:'\tgit diff > diff.output &&\n' span_id:103) (Token id:Id.Lit_Chars val:'\ttest_cmp diff.expect diff.output\n' span_id:104) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:tree span_id:111))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:115) (Token id: Id.Lit_Chars val: '\ttree=$(git write-tree 2>/dev/null) &&\n' span_id: 116 ) (Token id:Id.Lit_Chars val:'\ttest 8988da15d077d4829fc51d8544c097def6644dbb = $tree\n' span_id:117) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git diff-index -p HEAD' span_id:124))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:128) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:129) (Token id:Id.Lit_Chars val:'\ttree=$(git write-tree) &&\n' span_id:130) (Token id: Id.Lit_Chars val: '\tcommit=$(echo "Initial commit" | git commit-tree $tree) &&\n' span_id: 131 ) (Token id:Id.Lit_Chars val:'\tgit update-ref HEAD $commit &&\n' span_id:132) (Token id: Id.Lit_Chars val: '\tgit diff-index -p HEAD > diff.output &&\n' span_id: 133 ) (Token id:Id.Lit_Chars val:'\ttest_cmp diff.expect diff.output\n' span_id:134) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git diff HEAD' span_id:141))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:145) (Token id:Id.Lit_Chars val:'\tgit diff HEAD > diff.output &&\n' span_id:146) (Token id:Id.Lit_Chars val:'\ttest_cmp diff.expect diff.output\n' span_id:147) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:153) fd: -1 arg_word: {(whatchanged.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:157) fd: -1 here_begin: {(EOF)} here_end_span_id: 182 stdin_parts: [ ('commit VARIABLE\n') ('Author: VARIABLE\n') ('Date: VARIABLE\n') ('\n') (' Initial commit\n') ('\n') ('diff --git a/example b/example\n') ('new file mode 100644\n') ('index 0000000..f24c74a\n') ('--- /dev/null\n') ('+++ b/example\n') ('@@ -0,0 +1 @@\n') ('+Silly example\n') ('diff --git a/hello b/hello\n') ('new file mode 100644\n') ('index 0000000..557db03\n') ('--- /dev/null\n') ('+++ b/hello\n') ('@@ -0,0 +1 @@\n') ('+Hello World\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git whatchanged -p --root' span_id:187))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:191) (Token id:Id.Lit_Chars val:'\tgit whatchanged -p --root |\n' span_id:192) (Token id:Id.Lit_Chars val:'\t\tsed -e "1s/^\\(.\\{7\\}\\).\\{40\\}/\\1VARIABLE/" \\\n' span_id:193) (Token id: Id.Lit_Chars val: '\t\t-e "2,3s/^\\(.\\{8\\}\\).*$/\\1VARIABLE/" \\\n' span_id: 194 ) (Token id:Id.Lit_Chars val:'\t> whatchanged.output &&\n' span_id:195) (Token id: Id.Lit_Chars val: '\ttest_cmp whatchanged.expect whatchanged.output\n' span_id: 196 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git tag my-first-tag' span_id:203))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:207) (Token id:Id.Lit_Chars val:'\tgit tag my-first-tag &&\n' span_id:208) (Token id: Id.Lit_Chars val: '\ttest_cmp .git/refs/heads/master .git/refs/tags/my-first-tag\n' span_id: 209 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git checkout -b mybranch' span_id:216))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:220) (Token id:Id.Lit_Chars val:'\tgit checkout -b mybranch &&\n' span_id:221) (Token id: Id.Lit_Chars val: '\ttest_cmp .git/refs/heads/master .git/refs/heads/mybranch\n' span_id: 222 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:228) fd: -1 arg_word: {(branch.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:232) fd: -1 here_begin: {(EOF)} here_end_span_id: 238 stdin_parts: [(' master\n') ('* mybranch\n')] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git branch' span_id:243))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:247) (Token id:Id.Lit_Chars val:'\tgit branch > branch.output &&\n' span_id:248) (Token id:Id.Lit_Chars val:'\ttest_cmp branch.expect branch.output\n' span_id:249) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git resolve now fails' span_id:256))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:260) (Token id:Id.Lit_Chars val:'\tgit checkout mybranch &&\n' span_id:261) (Token id:Id.Lit_Chars val:'\techo "Work, work, work" >>hello &&\n' span_id:262) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:263) (Token id:Id.Lit_Chars val:'\tgit commit -m "Some work." -i hello &&\n' span_id:264) (Token id:Id.Lit_Chars val:'\n' span_id:265) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:266) (Token id:Id.Lit_Chars val:'\n' span_id:267) (Token id:Id.Lit_Chars val:'\techo "Play, play, play" >>hello &&\n' span_id:268) (Token id:Id.Lit_Chars val:'\techo "Lots of fun" >>example &&\n' span_id:269) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:270) (Token id: Id.Lit_Chars val: '\tgit commit -m "Some fun." -i hello example &&\n' span_id: 271 ) (Token id:Id.Lit_Chars val:'\n' span_id:272) (Token id: Id.Lit_Chars val: '\ttest_must_fail git merge -m "Merge work in mybranch" mybranch\n' span_id: 273 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:279) fd:-1 arg_word:{(hello)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:283) fd: -1 here_begin: {(EOF)} here_end_span_id: 292 stdin_parts: [ ('Hello World\n') ("It's a new day for git\n") ('Play, play, play\n') ('Work, work, work\n') ] ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:296) fd: -1 arg_word: {(show-branch.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:300) fd: -1 here_begin: {(EOF)} here_end_span_id: 311 stdin_parts: [ ('* [master] Merge work in mybranch\n') (' ! [mybranch] Some work.\n') ('--\n') ('- [master] Merge work in mybranch\n') ('*+ [mybranch] Some work.\n') ('* [master^] Some fun.\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git show-branch' span_id:316))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:320) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:321) (Token id:Id.Lit_Chars val:'\tgit commit -m "Merge work in mybranch" -i hello &&\n' span_id:322) (Token id: Id.Lit_Chars val: '\tgit show-branch --topo-order --more=1 master mybranch \\\n' span_id: 323 ) (Token id:Id.Lit_Chars val:'\t\t> show-branch.output &&\n' span_id:324) (Token id: Id.Lit_Chars val: '\ttest_cmp show-branch.expect show-branch.output\n' span_id: 325 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:331) fd: -1 arg_word: {(resolve.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:335) fd: -1 here_begin: {(EOF)} here_end_span_id: 345 stdin_parts: [ ('Updating VARIABLE..VARIABLE\n') ('FASTFORWARD (no commit created; -m option ignored)\n') (' example | 1 +\n') (' hello | 1 +\n') (' 2 files changed, 2 insertions(+)\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git resolve' span_id:350))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:354) (Token id:Id.Lit_Chars val:'\tgit checkout mybranch &&\n' span_id:355) (Token id:Id.Lit_Chars val:'\tgit merge -m "Merge upstream changes." master |\n' span_id:356) (Token id: Id.Lit_Chars val: '\t\tsed -e "1s/[0-9a-f]\\{7\\}/VARIABLE/g" \\\n' span_id: 357 ) (Token id: Id.Lit_Chars val: '\t\t-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output\n' span_id: 358 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git resolve output' span_id:365))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:369) (Token id: Id.Lit_Chars val: '\ttest_i18ncmp resolve.expect resolve.output\n' span_id: 370 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:376) fd: -1 arg_word: {(show-branch2.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:380) fd: -1 here_begin: {(EOF)} here_end_span_id: 389 stdin_parts: [ ('! [master] Merge work in mybranch\n') (' * [mybranch] Merge work in mybranch\n') ('--\n') ('-- [master] Merge work in mybranch\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git show-branch (part 2)' span_id:394))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:398) (Token id: Id.Lit_Chars val: '\tgit show-branch --topo-order master mybranch > show-branch2.output &&\n' span_id: 399 ) (Token id:Id.Lit_Chars val:'\ttest_cmp show-branch2.expect show-branch2.output\n' span_id:400) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:406) fd: -1 arg_word: {(show-branch3.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:410) fd: -1 here_begin: {(EOF)} here_end_span_id: 421 stdin_parts: [ ('! [master] Merge work in mybranch\n') (' * [mybranch] Merge work in mybranch\n') ('--\n') ('-- [master] Merge work in mybranch\n') ('+* [master^2] Some work.\n') ('+* [master^] Some fun.\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git show-branch (part 3)' span_id:426))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:430) (Token id: Id.Lit_Chars val: '\tgit show-branch --topo-order --more=2 master mybranch \\\n' span_id: 431 ) (Token id:Id.Lit_Chars val:'\t\t> show-branch3.output &&\n' span_id:432) (Token id: Id.Lit_Chars val: '\ttest_cmp show-branch3.expect show-branch3.output\n' span_id: 433 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rewind to "Some fun." and "Some work."' span_id:440))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:444) (Token id:Id.Lit_Chars val:'\tgit checkout mybranch &&\n' span_id:445) (Token id:Id.Lit_Chars val:'\tgit reset --hard master^2 &&\n' span_id:446) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:447) (Token id:Id.Lit_Chars val:'\tgit reset --hard master^\n' span_id:448) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:454) fd: -1 arg_word: {(show-branch4.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:458) fd: -1 here_begin: {(EOF)} here_end_span_id: 469 stdin_parts: [ ('* [master] Some fun.\n') (' ! [mybranch] Some work.\n') ('--\n') ('* [master] Some fun.\n') (' + [mybranch] Some work.\n') ('*+ [master^] Initial commit\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git show-branch (part 4)' span_id:474))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:478) (Token id: Id.Lit_Chars val: '\tgit show-branch --topo-order > show-branch4.output &&\n' span_id: 479 ) (Token id:Id.Lit_Chars val:'\ttest_cmp show-branch4.expect show-branch4.output\n' span_id:480) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'manual merge' span_id:487))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:491) (Token id: Id.Lit_Chars val: '\tmb=$(git merge-base HEAD mybranch) &&\n' span_id: 492 ) (Token id: Id.Lit_Chars val: '\tgit name-rev --name-only --tags $mb > name-rev.output &&\n' span_id: 493 ) (Token id:Id.Lit_Chars val:'\ttest "my-first-tag" = $(cat name-rev.output) &&\n' span_id:494) (Token id:Id.Lit_Chars val:'\n' span_id:495) (Token id:Id.Lit_Chars val:'\tgit read-tree -m -u $mb HEAD mybranch\n' span_id:496) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:502) fd: -1 arg_word: {(ls-files.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:506) fd: -1 here_begin: {(EOF)} here_end_span_id: 515 stdin_parts: [ ('100644 7f8b141b65fdcee47321e399a2598a235a032422 0\texample\n') ('100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1\thello\n') ('100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2\thello\n') ('100644 cc44c73eb783565da5831b4d820c962954019b69 3\thello\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git ls-files --stage' span_id:520))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:524) (Token id: Id.Lit_Chars val: '\tgit ls-files --stage > ls-files.output &&\n' span_id: 525 ) (Token id:Id.Lit_Chars val:'\ttest_cmp ls-files.expect ls-files.output\n' span_id:526) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:532) fd: -1 arg_word: {(ls-files-unmerged.expect)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:536) fd: -1 here_begin: {(EOF)} here_end_span_id: 544 stdin_parts: [ ('100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1\thello\n') ('100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2\thello\n') ('100644 cc44c73eb783565da5831b4d820c962954019b69 3\thello\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git ls-files --unmerged' span_id:549))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:553) (Token id: Id.Lit_Chars val: '\tgit ls-files --unmerged > ls-files-unmerged.output &&\n' span_id: 554 ) (Token id: Id.Lit_Chars val: '\ttest_cmp ls-files-unmerged.expect ls-files-unmerged.output\n' span_id: 555 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:git-merge-index span_id:562))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:566) (Token id: Id.Lit_Chars val: '\ttest_must_fail git merge-index git-merge-one-file hello\n' span_id: 567 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git ls-files --stage (part 2)' span_id:574))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:578) (Token id: Id.Lit_Chars val: '\tgit ls-files --stage > ls-files.output2 &&\n' span_id: 579 ) (Token id:Id.Lit_Chars val:'\ttest_cmp ls-files.expect ls-files.output2\n' span_id:580) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git repack' span_id:587))} {(SQ (Token id:Id.Lit_Chars val:'git repack' span_id:591))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git prune-packed' span_id:597))} {(SQ (Token id:Id.Lit_Chars val:'git prune-packed' span_id:601))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'-> only packed objects' span_id:607))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:611) (Token id: Id.Lit_Chars val: '\tgit prune && # Remove conflict marked blobs\n' span_id: 612 ) (Token id: Id.Lit_Chars val: '\ttest $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0\n' span_id: 613 ) ) } ) (C {(test_done)}) ] )