1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Use old python-git exception API for getref

The is_valid_object method is not even in Debian bullseye.
This commit is contained in:
Jochen Sprickerhof 2022-09-15 07:44:02 +02:00
parent 2aebc48a65
commit 0f48294a6e
No known key found for this signature in database
GPG Key ID: 5BFFDCC258E69433

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):