Skip to content

Commit d078c39

Browse files
agrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d4ed5d7 commit d078c39

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ test_expect_success 'rebase --keep-empty' '
7575
test_line_count = 6 actual
7676
'
7777

78+
cat > expect <<EOF
79+
Nothing to do
80+
EOF
81+
82+
test_expect_success 'rebase -i with empty HEAD' '
83+
set_fake_editor &&
84+
test_must_fail env FAKE_LINES="1 exec_true" git rebase -i HEAD^ >actual 2>&1 &&
85+
test_i18ncmp expect actual
86+
'
87+
7888
test_expect_success 'rebase -i with the exec command' '
7989
git checkout master &&
8090
(

0 commit comments

Comments
 (0)