Skip to content

Commit

Permalink
job.py: don't hard-code branch in error-handling
Browse files Browse the repository at this point in the history
When MR was created against a branch different from master and ended up
with conflicts, bot goes into infinite loop due to getting inside
error-handling path a:

    fatal: invalid reference: master

Fix this by not hard-coding the master name.

Signed-off-by: Konstantin Kharlamov <[email protected]>
  • Loading branch information
Hi-Angel committed Jan 29, 2021
1 parent b2b115b commit d0ff9d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marge/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def update_from_target_branch_and_push(
# and likely explains any previous failure, so it will better to just
# raise a GitError
if source_branch != 'master':
repo.checkout_branch('master')
repo.checkout_branch('HEAD^')
repo.remove_branch(source_branch)

if not branch_update_done:
Expand Down

0 comments on commit d0ff9d5

Please sign in to comment.