summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t3427-rebase-subtree.sh38
1 files changed, 13 insertions, 25 deletions
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 36c4f92e06..64ba95f3e0 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -56,16 +56,18 @@ test_expect_success 'setup' '
: add two extra commits to rebase &&
test_commit -C files_subtree master4 &&
- test_commit files_subtree/master5
+ test_commit files_subtree/master5 &&
+
+ git checkout -b to-rebase &&
+ git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
+ git commit -m "Empty commit" --allow-empty
'
# FAILURE: Does not preserve master4.
test_expect_failure REBASE_P \
'Rebase -Xsubtree --preserve-merges --onto commit 4' '
reset_rebase &&
- git checkout -b rebase-preserve-merges-4 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-preserve-merges-4 to-rebase &&
git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
verbose test "$(commit_message HEAD~)" = "files_subtree/master4"
'
@@ -74,9 +76,7 @@ test_expect_failure REBASE_P \
test_expect_failure REBASE_P \
'Rebase -Xsubtree --preserve-merges --onto commit 5' '
reset_rebase &&
- git checkout -b rebase-preserve-merges-5 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-preserve-merges-5 to-rebase &&
git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
verbose test "$(commit_message HEAD)" = "files_subtree/master5"
'
@@ -85,9 +85,7 @@ test_expect_failure REBASE_P \
test_expect_failure REBASE_P \
'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 4' '
reset_rebase &&
- git checkout -b rebase-keep-empty-4 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-keep-empty-4 to-rebase &&
git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
verbose test "$(commit_message HEAD~2)" = "files_subtree/master4"
'
@@ -96,9 +94,7 @@ test_expect_failure REBASE_P \
test_expect_failure REBASE_P \
'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit 5' '
reset_rebase &&
- git checkout -b rebase-keep-empty-5 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-keep-empty-5 to-rebase &&
git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
verbose test "$(commit_message HEAD~)" = "files_subtree/master5"
'
@@ -107,9 +103,7 @@ test_expect_failure REBASE_P \
test_expect_failure REBASE_P \
'Rebase -Xsubtree --keep-empty --preserve-merges --onto empty commit' '
reset_rebase &&
- git checkout -b rebase-keep-empty-empty master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-keep-empty-empty to-rebase &&
git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
verbose test "$(commit_message HEAD)" = "Empty commit"
'
@@ -117,9 +111,7 @@ test_expect_failure REBASE_P \
# FAILURE: fatal: Could not parse object
test_expect_failure 'Rebase -Xsubtree --onto commit 4' '
reset_rebase &&
- git checkout -b rebase-onto-4 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-onto-4 to-rebase &&
git rebase -Xsubtree=files_subtree --onto files-master master &&
verbose test "$(commit_message HEAD~2)" = "files_subtree/master4"
'
@@ -127,18 +119,14 @@ test_expect_failure 'Rebase -Xsubtree --onto commit 4' '
# FAILURE: fatal: Could not parse object
test_expect_failure 'Rebase -Xsubtree --onto commit 5' '
reset_rebase &&
- git checkout -b rebase-onto-5 master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-onto-5 to-rebase &&
git rebase -Xsubtree=files_subtree --onto files-master master &&
verbose test "$(commit_message HEAD~)" = "files_subtree/master5"
'
# FAILURE: fatal: Could not parse object
test_expect_failure 'Rebase -Xsubtree --onto empty commit' '
reset_rebase &&
- git checkout -b rebase-onto-empty master &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
- git commit -m "Empty commit" --allow-empty &&
+ git checkout -b rebase-onto-empty to-rebase &&
git rebase -Xsubtree=files_subtree --onto files-master master &&
verbose test "$(commit_message HEAD)" = "Empty commit"
'