summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t3424-rebase-empty.sh66
-rwxr-xr-xt/t3427-rebase-subtree.sh8
2 files changed, 65 insertions, 9 deletions
diff --git a/t/t3424-rebase-empty.sh b/t/t3424-rebase-empty.sh
index 3b716e980e..cfb1ebc1ff 100755
--- a/t/t3424-rebase-empty.sh
+++ b/t/t3424-rebase-empty.sh
@@ -34,7 +34,7 @@ test_expect_success 'setup test repository' '
git commit -m "Five letters ought to be enough for anybody"
'
-test_expect_failure 'rebase (am-backend) with a variety of empty commits' '
+test_expect_failure 'rebase (am-backend)' '
test_when_finished "git rebase --abort" &&
git checkout -B testing localmods &&
# rebase (--am) should not drop commits that start empty
@@ -45,10 +45,17 @@ test_expect_failure 'rebase (am-backend) with a variety of empty commits' '
test_cmp expect actual
'
-test_expect_failure 'rebase --merge with a variety of empty commits' '
- test_when_finished "git rebase --abort" &&
+test_expect_success 'rebase --merge --empty=drop' '
+ git checkout -B testing localmods &&
+ git rebase --merge --empty=drop upstream &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --merge uses default of --empty=drop' '
git checkout -B testing localmods &&
- # rebase --merge should not halt on the commit that becomes empty
git rebase --merge upstream &&
test_write_lines D C B A >expect &&
@@ -56,7 +63,56 @@ test_expect_failure 'rebase --merge with a variety of empty commits' '
test_cmp expect actual
'
-test_expect_success 'rebase --interactive with a variety of empty commits' '
+test_expect_success 'rebase --merge --empty=keep' '
+ git checkout -B testing localmods &&
+ git rebase --merge --empty=keep upstream &&
+
+ test_write_lines D C2 C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --merge --empty=ask' '
+ git checkout -B testing localmods &&
+ test_must_fail git rebase --merge --empty=ask upstream &&
+
+ git rebase --skip &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --interactive --empty=drop' '
+ git checkout -B testing localmods &&
+ git rebase --interactive --empty=drop upstream &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --interactive --empty=keep' '
+ git checkout -B testing localmods &&
+ git rebase --interactive --empty=keep upstream &&
+
+ test_write_lines D C2 C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --interactive --empty=ask' '
+ git checkout -B testing localmods &&
+ test_must_fail git rebase --interactive --empty=ask upstream &&
+
+ git rebase --skip &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --interactive uses default of --empty=ask' '
git checkout -B testing localmods &&
test_must_fail git rebase --interactive upstream &&
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 8dceef61cf..79e43a370b 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -85,10 +85,10 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --
verbose test "$(commit_message HEAD)" = "Empty commit"
'
-test_expect_success 'Rebase -Xsubtree --onto commit' '
+test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
reset_rebase &&
git checkout -b rebase-onto to-rebase &&
- test_must_fail git rebase -Xsubtree=files_subtree --onto files-master master &&
+ test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
: first pick results in no changes &&
git rebase --skip &&
verbose test "$(commit_message HEAD~2)" = "master4" &&
@@ -96,10 +96,10 @@ test_expect_success 'Rebase -Xsubtree --onto commit' '
verbose test "$(commit_message HEAD)" = "Empty commit"
'
-test_expect_success 'Rebase -Xsubtree --rebase-merges --onto commit' '
+test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
reset_rebase &&
git checkout -b rebase-merges-onto to-rebase &&
- test_must_fail git rebase -Xsubtree=files_subtree --rebase-merges --onto files-master --root &&
+ test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
: first pick results in no changes &&
git rebase --skip &&
verbose test "$(commit_message HEAD~2)" = "master4" &&