Skip to content

Commit

Permalink
Cherry pick empty commit (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu authored Apr 11, 2022
1 parent 18682b5 commit 46e3579
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,17 @@ def apply_patch(branch, comm_ci):
git('cherry-pick', git_commit.sha)
except sh.ErrorReturnCode as e:
err = str(e)
print(">>> Fail to apply the patch to branch {}, cause: {}".format(branch, err))
if err.find('more, please see e.stdout') >= 0:
err = e.stdout.decode()
conflict_files = conflict_file_list(err.splitlines())
# git('cherry-pick', '--abort')
# overwrite_conflict_files(git_commit)
commit_changes(comm_ci)
stopped = True
if err.find('git commit --allow-empty') >= 0:
git('commit', '--allow-empty', '--allow-empty-message', '--no-edit')
else:
print(">>> Fail to apply the patch to branch {}, cause: {}".format(branch, err))
if err.find('more, please see e.stdout') >= 0:
err = e.stdout.decode()
conflict_files = conflict_file_list(err.splitlines())
# git('cherry-pick', '--abort')
# overwrite_conflict_files(git_commit)
commit_changes(comm_ci)
stopped = True

try:
git.push("-u", "origin", branch)
Expand Down

0 comments on commit 46e3579

Please sign in to comment.