(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'A simple turial in the form of a test case'>)} 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'>)} ) (command.Simple words: [{<echo>} {(DQ <'It\'s a new day for git'>)}] redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<hello>})] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<diff.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'>)} ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<whatchanged.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<branch.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {<EOF>} here_end_span_id: 238 stdin_parts: [<' master\n'> <'* mybranch\n'>] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<hello>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<show-branch.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<resolve.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'>)} ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<show-branch2.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<show-branch3.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<show-branch4.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<ls-files.expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<ls-files-unmerged.expect>} ) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine 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'> ] ) ) ] do_fork: T ) (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>}) ] )