1
0
Fork 0

handle broader range or git exceptions

This commit is contained in:
Mikhail Goncharov 2020-07-23 21:49:44 +02:00
parent a6b4529d25
commit 2932ea50e3

View file

@ -165,8 +165,8 @@ class ApplyPatch:
self.repo.delete_head('--force', self.branch_name)
try:
commit = self.repo.commit(base_revision)
except BadName:
logging.info('Revision {} not found in upstream repository, using master instead.'.format(base_revision))
except Exception as e:
logging.info('Cannot resolve revision {}: {}, going to use "master" instead.'.format(base_revision, e))
commit = self.repo.heads['master']
logging.info(f'creating branch {self.branch_name} at {commit.hexsha}')
new_branch = self.repo.create_head(self.branch_name, commit.hexsha)