summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 352a52e..d392160 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -981,7 +981,35 @@ test_expect_success 'rebase -i --root reword root commit' '
test -z "$(git show -s --format=%p HEAD^)"
'
+test_expect_success 'rebase -i --root when root has untracked file confilct' '
+ test_when_finished "reset_rebase" &&
+ git checkout -b failing-root-pick A &&
+ echo x >file2 &&
+ git rm file1 &&
+ git commit -m "remove file 1 add file 2" &&
+ echo z >file1 &&
+ set_fake_editor &&
+ test_must_fail env FAKE_LINES="1 2" git rebase -i --root &&
+ rm file1 &&
+ git rebase --continue &&
+ test "$(git log -1 --format=%B)" = "remove file 1 add file 2" &&
+ test "$(git rev-list --count HEAD)" = 2
+'
+
+test_expect_success 'rebase -i --root reword root when root has untracked file conflict' '
+ test_when_finished "reset_rebase" &&
+ echo z>file1 &&
+ set_fake_editor &&
+ test_must_fail env FAKE_LINES="reword 1 2" \
+ FAKE_COMMIT_MESSAGE="Modified A" git rebase -i --root &&
+ rm file1 &&
+ FAKE_COMMIT_MESSAGE="Reworded A" git rebase --continue &&
+ test "$(git log -1 --format=%B HEAD^)" = "Reworded A" &&
+ test "$(git rev-list --count HEAD)" = 2
+'
+
test_expect_success C_LOCALE_OUTPUT 'rebase --edit-todo does not work on non-interactive rebase' '
+ git checkout reword-root-branch &&
git reset --hard &&
git checkout conflict-branch &&
set_fake_editor &&