don't fail if branch cannot be deleted
This commit is contained in:
parent
33c5072489
commit
24336ae2e4
1 changed files with 5 additions and 2 deletions
|
@ -163,8 +163,11 @@ class ApplyPatch:
|
|||
|
||||
def _create_branch(self, base_revision: Optional[str]):
|
||||
self.repo.git.fetch('--all')
|
||||
if self.branch_name in self.repo.heads:
|
||||
self.repo.delete_head('--force', self.branch_name)
|
||||
try:
|
||||
if self.branch_name in self.repo.heads:
|
||||
self.repo.delete_head('--force', self.branch_name)
|
||||
except:
|
||||
logging.warning('cannot delete branch {}'.format(self.branch_name))
|
||||
try:
|
||||
commit = self.repo.commit(base_revision)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in a new issue