From 90917bf8b2b805889fe10eb5876f43a9b338b2ca Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Sat, 16 Jun 2018 12:32:14 -0700 Subject: [PATCH] Explicit push location to ignore user git config Users can configure what strategy "git push" uses to determine which remote branch it should push to. Cherry-picker doesn't work with all of the git push strategies but we can make explicit what the remote branch should be which works around that problem. --- cherry_picker/cherry_picker/cherry_picker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cherry_picker/cherry_picker/cherry_picker.py b/cherry_picker/cherry_picker/cherry_picker.py index abf37b7..d974444 100755 --- a/cherry_picker/cherry_picker/cherry_picker.py +++ b/cherry_picker/cherry_picker/cherry_picker.py @@ -202,7 +202,7 @@ def amend_commit_message(self, cherry_pick_branch): def push_to_remote(self, base_branch, head_branch, commit_message=""): """ git push """ - cmd = ['git', 'push', self.pr_remote, head_branch] + cmd = ['git', 'push', self.pr_remote, f'{head_branch}:{head_branch}'] try: self.run_cmd(cmd) except subprocess.CalledProcessError: