diff --git a/cherry_picker/cherry_picker.py b/cherry_picker/cherry_picker.py index 4f24e44..d83ed67 100755 --- a/cherry_picker/cherry_picker.py +++ b/cherry_picker/cherry_picker.py @@ -277,7 +277,7 @@ def amend_commit_message(self, cherry_pick_branch): click.echo(cpe.output) return updated_commit_message - def push_to_remote(self, base_branch, head_branch, commit_message=""): + def push_to_remote(self, base_branch, head_branch, commit_message): """ git push """ set_state(WORKFLOW_STATES.PUSHING_TO_REMOTE) @@ -468,7 +468,10 @@ def continue_cherry_pick(self): ] subprocess.check_output(cmd, stderr=subprocess.STDOUT) - self.push_to_remote(base, cherry_pick_branch) + self.push_to_remote( + base, cherry_pick_branch, + updated_commit_message, + ) self.cleanup_branch(cherry_pick_branch) diff --git a/cherry_picker/test.py b/cherry_picker/test.py index 6dd5b76..7c0aadb 100644 --- a/cherry_picker/test.py +++ b/cherry_picker/test.py @@ -648,7 +648,7 @@ def test_push_to_remote_fail(tmp_git_repo_dir): with mock.patch("cherry_picker.cherry_picker.validate_sha", return_value=True): cherry_picker = CherryPicker("origin", "xxx", []) - cherry_picker.push_to_remote("master", "backport-branch-test") + cherry_picker.push_to_remote("master", "backport-branch-test", "") assert get_state() == WORKFLOW_STATES.PUSHING_TO_REMOTE_FAILED @@ -659,7 +659,7 @@ def test_push_to_remote_interactive(tmp_git_repo_dir): with mock.patch.object(cherry_picker, "run_cmd"), mock.patch.object( cherry_picker, "open_pr" ), mock.patch.object(cherry_picker, "get_pr_url", return_value="https://pr_url"): - cherry_picker.push_to_remote("master", "backport-branch-test") + cherry_picker.push_to_remote("master", "backport-branch-test", "") assert get_state() == WORKFLOW_STATES.PR_OPENING @@ -671,7 +671,7 @@ def test_push_to_remote_botflow(tmp_git_repo_dir, monkeypatch): with mock.patch.object(cherry_picker, "run_cmd"), mock.patch.object( cherry_picker, "create_gh_pr" ): - cherry_picker.push_to_remote("master", "backport-branch-test") + cherry_picker.push_to_remote("master", "backport-branch-test", "") assert get_state() == WORKFLOW_STATES.PR_CREATING