(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: { (SQ <'git rebase tests for -Xsubtree\n'> <'\n'> <'This test runs git rebase and tests the subtree strategy.\n'> ) } spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<.>} {(DQ ($ Id.VSub_DollarName TEST_DIRECTORY)) <'/lib-rebase.sh'>}) (command.ShFunction name: commit_message body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (C {<git>} {<log>} {<--pretty> <Id.Lit_Equals '='> <format> <Id.Lit_Colon ':'> <Id.Lit_Other '%'> <s>} {<-1>} {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\ttest_commit README &&\n'> <'\tmkdir files &&\n'> <'\t(\n'> <'\t\tcd files &&\n'> <'\t\tgit init &&\n'> <'\t\ttest_commit master1 &&\n'> <'\t\ttest_commit master2 &&\n'> <'\t\ttest_commit master3\n'> <'\t) &&\n'> <'\tgit fetch files master &&\n'> <'\tgit branch files-master FETCH_HEAD &&\n'> <'\tgit read-tree --prefix=files_subtree files-master &&\n'> <'\tgit checkout -- files_subtree &&\n'> <'\ttree=$(git write-tree) &&\n'> <'\thead=$(git rev-parse HEAD) &&\n'> <'\trev=$(git rev-parse --verify files-master^0) &&\n'> <'\tcommit=$(git commit-tree -p $head -p $rev -m "Add subproject master" $tree) &&\n'> <'\tgit update-ref HEAD $commit &&\n'> <'\t(\n'> <'\t\tcd files_subtree &&\n'> <'\t\ttest_commit master4\n'> <'\t) &&\n'> <'\ttest_commit files_subtree/master5\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --preserve-merges --onto commit 4'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-preserve-merges-4 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> <'\tgit rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&\n'> <'\tverbose test "$(commit_message HEAD~)" = "files_subtree/master4"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --preserve-merges --onto commit 5'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-preserve-merges-5 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> <'\tgit rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&\n'> <'\tverbose test "$(commit_message HEAD)" = "files_subtree/master5"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 4'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-keep-empty-4 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> < '\tgit rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&\n' > <'\tverbose test "$(commit_message HEAD~2)" = "files_subtree/master4"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 5'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-keep-empty-5 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> < '\tgit rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&\n' > <'\tverbose test "$(commit_message HEAD~)" = "files_subtree/master5"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --keep-empty --preserve-merges --onto empty commit'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-keep-empty-empty master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> < '\tgit rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&\n' > <'\tverbose test "$(commit_message HEAD)" = "Empty commit"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --onto commit 4'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-onto-4 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> <'\tgit rebase -Xsubtree=files_subtree --onto files-master master &&\n'> <'\tverbose test "$(commit_message HEAD~2)" = "files_subtree/master4"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --onto commit 5'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-onto-5 master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> <'\tgit rebase -Xsubtree=files_subtree --onto files-master master &&\n'> <'\tverbose test "$(commit_message HEAD~)" = "files_subtree/master5"\n'> ) } ) (C {<test_expect_failure>} {(SQ <'Rebase -Xsubtree --onto empty commit'>)} { (SQ <'\n'> <'\treset_rebase &&\n'> <'\tgit checkout -b rebase-onto-empty master &&\n'> <'\tgit filter-branch --prune-empty -f --subdirectory-filter files_subtree &&\n'> <'\tgit commit -m "Empty commit" --allow-empty &&\n'> <'\tgit rebase -Xsubtree=files_subtree --onto files-master master &&\n'> <'\tverbose test "$(commit_message HEAD)" = "Empty commit"\n'> ) } ) (C {<test_done>}) ] )