1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Merge branch 'fix_getref' into 'master'

Use old python-git exception API for getref

See merge request fdroid/fdroidserver!1190
This commit is contained in:
Michael Pöhn 2022-09-15 08:35:10 +00:00
commit 603c8c5cd4

View File

@ -1253,9 +1253,10 @@ class vcs_git(vcs):
def getref(self, revname='HEAD'):
self.checkrepo()
repo = git.Repo(self.local)
if not repo.is_valid_object(revname):
try:
return repo.commit(revname).hexsha
except git.BadName:
return None
return repo.commit(revname).hexsha
class vcs_gitsvn(vcs):