Skip to content

Commit 93a9d26

Browse files
committed
use force when deleting existing branch in new_pr_from_branch
1 parent 4e28b43 commit 93a9d26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

easybuild/tools/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ def new_pr_from_branch(branch_name, title=None, descr=None, pr_metadata=None):
13321332
remote = create_remote(git_repo, pr_target_account, pr_target_repo, https=True)
13331333
git_repo.git.fetch(remote.name)
13341334
if pr_target_branch in [b.name for b in git_repo.branches]:
1335-
git_repo.delete_head(pr_target_branch)
1335+
git_repo.delete_head(pr_target_branch, force=True)
13361336
git_repo.git.checkout('remotes/%s/%s' % (remote.name, pr_target_branch), track=True, force=True)
13371337

13381338
print_msg("determining metadata for pull request based on changed files...", log=_log)
@@ -1379,7 +1379,7 @@ def new_pr_from_branch(branch_name, title=None, descr=None, pr_metadata=None):
13791379
remote = create_remote(git_repo, github_account, pr_target_repo, https=True)
13801380
git_repo.git.fetch(remote.name)
13811381
if branch_name in [b.name for b in git_repo.branches]:
1382-
git_repo.delete_head(branch_name)
1382+
git_repo.delete_head(branch_name, force=True)
13831383
git_repo.git.checkout('remotes/%s/%s' % (remote.name, branch_name), track=True, force=True)
13841384

13851385
# path to easyconfig files is expected to be absolute in det_file_info

0 commit comments

Comments
 (0)