rebase -i: Add tests for "--edit-todo"

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Andrew Wong committed Sep 17, 2012 at 21:28 UTC 9f4981bac6f492d332785b8ed03f33a167952f38
1 file changed +18
t/t3404-rebase-interactive.sh
+18
@@ -911,4 +911,22 @@ test_expect_success 'rebase -i --root fixup root commit' '
911 test 0 = $(git cat-file commit HEAD | grep -c ^parent\ )
912 '
913
914 +test_expect_success 'rebase --edit-todo does not works on non-interactive rebase' '
915 + git reset --hard &&
916 + git checkout conflict-branch &&
917 + test_must_fail git rebase --onto HEAD~2 HEAD~ &&
918 + test_must_fail git rebase --edit-todo &&
919 + git rebase --abort
920 +'
921 +
922 +test_expect_success 'rebase --edit-todo can be used to modify todo' '
923 + git reset --hard &&
924 + git checkout no-conflict-branch^0 &&
925 + FAKE_LINES="edit 1 2 3" git rebase -i HEAD~3 &&
926 + FAKE_LINES="2 1" git rebase --edit-todo &&
927 + git rebase --continue
928 + test M = $(git cat-file commit HEAD^ | sed -ne \$p) &&
929 + test L = $(git cat-file commit HEAD | sed -ne \$p)
930 +'
931 +
932 test_done