diff --git a/builtin/commit.c b/builtin/commit.c index 569e31fb60..610820c99f 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -520,8 +520,6 @@ static const char *prepare_index(const char **argv, const char *prefix, die(_("cannot do a partial commit during a merge.")); else if (is_from_cherry_pick(whence)) die(_("cannot do a partial commit during a cherry-pick.")); - else if (is_from_rebase_empty(whence)) - die(_("cannot do a partial commit during a rebase.")); } if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec)) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 58b3bb0c27..17b30b7825 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -1829,7 +1829,7 @@ test_expect_success 'post-commit hook is called' ' test_cmp expect actual ' -test_expect_success 'correct error message for partial commit after empty pick' ' +test_expect_success 'partial commit is allowed when a rebase pick becomes empty' ' test_when_finished "git rebase --abort" && ( set_fake_editor && @@ -1838,8 +1838,7 @@ test_expect_success 'correct error message for partial commit after empty pick' test_must_fail git rebase -i A D ) && echo x >file1 && - test_must_fail git commit file1 2>err && - test_grep "cannot do a partial commit during a rebase." err + git commit file1 ' test_expect_success 'correct error message for commit --amend after empty pick' '