(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"A simple turial in the form of a test case">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <blob>)} { (SQ <"\n"> <"\techo \"Hello World\" > hello &&\n"> <"\techo \"Silly example\" > example &&\n"> <"\n"> <"\tgit update-index --add hello example &&\n"> <"\n"> <"\ttest blob = \"$(git cat-file -t 557db03)\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"blob 557db03">)} {(SQ <"\n"> <"\ttest \"Hello World\" = \"$(git cat-file blob 557db03)\"\n">)} ) (SimpleCommand words: [{(echo)} {(DQ ("It's a new day for git"))}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(hello)} spids:[59])] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(diff.expect)} spids:[64]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("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") ) } do_expansion: True here_end: EOF was_filled: True spids: [68] ) ] ) (C {(test_expect_success)} {(SQ <"git diff-files -p">)} { (SQ <"\n"> <"\tgit diff-files -p > diff.output &&\n"> <"\ttest_cmp diff.expect diff.output\n">) } ) (C {(test_expect_success)} {(SQ <"git diff">)} {(SQ <"\n"> <"\tgit diff > diff.output &&\n"> <"\ttest_cmp diff.expect diff.output\n">)} ) (C {(test_expect_success)} {(SQ <tree>)} { (SQ <"\n"> <"\ttree=$(git write-tree 2>/dev/null) &&\n"> <"\ttest 8988da15d077d4829fc51d8544c097def6644dbb = $tree\n"> ) } ) (C {(test_expect_success)} {(SQ <"git diff-index -p HEAD">)} { (SQ <"\n"> <"\ttest_tick &&\n"> <"\ttree=$(git write-tree) &&\n"> <"\tcommit=$(echo \"Initial commit\" | git commit-tree $tree) &&\n"> <"\tgit update-ref HEAD $commit &&\n"> <"\tgit diff-index -p HEAD > diff.output &&\n"> <"\ttest_cmp diff.expect diff.output\n"> ) } ) (C {(test_expect_success)} {(SQ <"git diff HEAD">)} {(SQ <"\n"> <"\tgit diff HEAD > diff.output &&\n"> <"\ttest_cmp diff.expect diff.output\n">)} ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(whatchanged.expect)} spids:[151]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("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") ) } do_expansion: True here_end: EOF was_filled: True spids: [155] ) ] ) (C {(test_expect_success)} {(SQ <"git whatchanged -p --root">)} { (SQ <"\n"> <"\tgit whatchanged -p --root |\n"> <"\t\tsed -e \"1s/^\\(.\\{7\\}\\).\\{40\\}/\\1VARIABLE/\" \\\n"> <"\t\t-e \"2,3s/^\\(.\\{8\\}\\).*$/\\1VARIABLE/\" \\\n"> <"\t> whatchanged.output &&\n"> <"\ttest_cmp whatchanged.expect whatchanged.output\n"> ) } ) (C {(test_expect_success)} {(SQ <"git tag my-first-tag">)} { (SQ <"\n"> <"\tgit tag my-first-tag &&\n"> <"\ttest_cmp .git/refs/heads/master .git/refs/tags/my-first-tag\n"> ) } ) (C {(test_expect_success)} {(SQ <"git checkout -b mybranch">)} { (SQ <"\n"> <"\tgit checkout -b mybranch &&\n"> <"\ttest_cmp .git/refs/heads/master .git/refs/heads/mybranch\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(branch.expect)} spids:[224]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ (" master\n") ("* mybranch\n"))} do_expansion: True here_end: EOF was_filled: True spids: [228] ) ] ) (C {(test_expect_success)} {(SQ <"git branch">)} { (SQ <"\n"> <"\tgit branch > branch.output &&\n"> <"\ttest_cmp branch.expect branch.output\n">) } ) (C {(test_expect_success)} {(SQ <"git resolve now fails">)} { (SQ <"\n"> <"\tgit checkout mybranch &&\n"> <"\techo \"Work, work, work\" >>hello &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m \"Some work.\" -i hello &&\n"> <"\n"> <"\tgit checkout master &&\n"> <"\n"> <"\techo \"Play, play, play\" >>hello &&\n"> <"\techo \"Lots of fun\" >>example &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m \"Some fun.\" -i hello example &&\n"> <"\n"> <"\ttest_must_fail git merge -m \"Merge work in mybranch\" mybranch\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(hello)} spids:[273]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("Hello World\n") ("It's a new day for git\n") ("Play, play, play\n") ("Work, work, work\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [277] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(show-branch.expect)} spids:[288]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("* [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") ) } do_expansion: True here_end: EOF was_filled: True spids: [292] ) ] ) (C {(test_expect_success)} {(SQ <"git show-branch">)} { (SQ <"\n"> <"\ttest_tick &&\n"> <"\tgit commit -m \"Merge work in mybranch\" -i hello &&\n"> <"\tgit show-branch --topo-order --more=1 master mybranch \\\n"> <"\t\t> show-branch.output &&\n"> <"\ttest_cmp show-branch.expect show-branch.output\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(resolve.expect)} spids:[321]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("Updating VARIABLE..VARIABLE\n") ("FASTFORWARD (no commit created; -m option ignored)\n") (" example | 1 +\n") (" hello | 1 +\n") (" 2 files changed, 2 insertions(+)\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [325] ) ] ) (C {(test_expect_success)} {(SQ <"git resolve">)} { (SQ <"\n"> <"\tgit checkout mybranch &&\n"> <"\tgit merge -m \"Merge upstream changes.\" master |\n"> <"\t\tsed -e \"1s/[0-9a-f]\\{7\\}/VARIABLE/g\" \\\n"> <"\t\t-e \"s/^Fast[- ]forward /FASTFORWARD /\" >resolve.output\n"> ) } ) (C {(test_expect_success)} {(SQ <"git resolve output">)} {(SQ <"\n"> <"\ttest_i18ncmp resolve.expect resolve.output\n">)} ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(show-branch2.expect)} spids:[364]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("! [master] Merge work in mybranch\n") (" * [mybranch] Merge work in mybranch\n") ("--\n") ("-- [master] Merge work in mybranch\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [368] ) ] ) (C {(test_expect_success)} {(SQ <"git show-branch (part 2)">)} { (SQ <"\n"> <"\tgit show-branch --topo-order master mybranch > show-branch2.output &&\n"> <"\ttest_cmp show-branch2.expect show-branch2.output\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(show-branch3.expect)} spids:[392]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("! [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") ) } do_expansion: True here_end: EOF was_filled: True spids: [396] ) ] ) (C {(test_expect_success)} {(SQ <"git show-branch (part 3)">)} { (SQ <"\n"> <"\tgit show-branch --topo-order --more=2 master mybranch \\\n"> <"\t\t> show-branch3.output &&\n"> <"\ttest_cmp show-branch3.expect show-branch3.output\n"> ) } ) (C {(test_expect_success)} {(SQ <"rewind to \"Some fun.\" and \"Some work.\"">)} { (SQ <"\n"> <"\tgit checkout mybranch &&\n"> <"\tgit reset --hard master^2 &&\n"> <"\tgit checkout master &&\n"> <"\tgit reset --hard master^\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(show-branch4.expect)} spids:[438]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("* [master] Some fun.\n") (" ! [mybranch] Some work.\n") ("--\n") ("* [master] Some fun.\n") (" + [mybranch] Some work.\n") ("*+ [master^] Initial commit\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [442] ) ] ) (C {(test_expect_success)} {(SQ <"git show-branch (part 4)">)} { (SQ <"\n"> <"\tgit show-branch --topo-order > show-branch4.output &&\n"> <"\ttest_cmp show-branch4.expect show-branch4.output\n"> ) } ) (C {(test_expect_success)} {(SQ <"manual merge">)} { (SQ <"\n"> <"\tmb=$(git merge-base HEAD mybranch) &&\n"> <"\tgit name-rev --name-only --tags $mb > name-rev.output &&\n"> <"\ttest \"my-first-tag\" = $(cat name-rev.output) &&\n"> <"\n"> <"\tgit read-tree -m -u $mb HEAD mybranch\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(ls-files.expect)} spids:[484]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("100644 7f8b141b65fdcee47321e399a2598a235a032422 0\texample\n") ("100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1\thello\n") ("100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2\thello\n") ("100644 cc44c73eb783565da5831b4d820c962954019b69 3\thello\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [488] ) ] ) (C {(test_expect_success)} {(SQ <"git ls-files --stage">)} { (SQ <"\n"> <"\tgit ls-files --stage > ls-files.output &&\n"> <"\ttest_cmp ls-files.expect ls-files.output\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(ls-files-unmerged.expect)} spids:[512]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1\thello\n") ("100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2\thello\n") ("100644 cc44c73eb783565da5831b4d820c962954019b69 3\thello\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [516] ) ] ) (C {(test_expect_success)} {(SQ <"git ls-files --unmerged">)} { (SQ <"\n"> <"\tgit ls-files --unmerged > ls-files-unmerged.output &&\n"> <"\ttest_cmp ls-files-unmerged.expect ls-files-unmerged.output\n"> ) } ) (C {(test_expect_success)} {(SQ <git-merge-index>)} {(SQ <"\n"> <"\ttest_must_fail git merge-index git-merge-one-file hello\n">)} ) (C {(test_expect_success)} {(SQ <"git ls-files --stage (part 2)">)} { (SQ <"\n"> <"\tgit ls-files --stage > ls-files.output2 &&\n"> <"\ttest_cmp ls-files.expect ls-files.output2\n"> ) } ) (C {(test_expect_success)} {(SQ <"git repack">)} {(SQ <"git repack">)}) (C {(test_expect_success)} {(SQ <"git prune-packed">)} {(SQ <"git prune-packed">)}) (C {(test_expect_success)} {(SQ <"-> only packed objects">)} { (SQ <"\n"> <"\tgit prune && # Remove conflict marked blobs\n"> <"\ttest $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0\n"> ) } ) (C {(test_done)}) ] )