summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2018-08-10 16:51:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-10 18:56:22 (GMT)
commitd078c39106895b26512ca6b259d66fe64b274e1b (patch)
tree0d2279352e372738da5be4ef3680616987b075a6 /t/t3404-rebase-interactive.sh
parentd4ed5d7713c779487a52d30e83185a056c4bf023 (diff)
downloadgit-d078c39106895b26512ca6b259d66fe64b274e1b.zip
git-d078c39106895b26512ca6b259d66fe64b274e1b.tar.gz
git-d078c39106895b26512ca6b259d66fe64b274e1b.tar.bz2
t3404: todo list with commented-out commands only aborts
If the todo list generated by `--make-script` is empty, complete_action() writes a noop, but if it has only commented-out commands, it will abort with the message "Nothing to do", and does not launch the editor. This adds a new test to ensure that complete_action() behaves this way. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index d392160..7755b68 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -75,6 +75,16 @@ test_expect_success 'rebase --keep-empty' '
test_line_count = 6 actual
'
+cat > expect <<EOF
+Nothing to do
+EOF
+
+test_expect_success 'rebase -i with empty HEAD' '
+ set_fake_editor &&
+ test_must_fail env FAKE_LINES="1 exec_true" git rebase -i HEAD^ >actual 2>&1 &&
+ test_i18ncmp expect actual
+'
+
test_expect_success 'rebase -i with the exec command' '
git checkout master &&
(