mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03: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:
commit
603c8c5cd4
1 changed files with 3 additions and 2 deletions
|
|
@ -1253,9 +1253,10 @@ class vcs_git(vcs):
|
||||||
def getref(self, revname='HEAD'):
|
def getref(self, revname='HEAD'):
|
||||||
self.checkrepo()
|
self.checkrepo()
|
||||||
repo = git.Repo(self.local)
|
repo = git.Repo(self.local)
|
||||||
if not repo.is_valid_object(revname):
|
try:
|
||||||
return None
|
|
||||||
return repo.commit(revname).hexsha
|
return repo.commit(revname).hexsha
|
||||||
|
except git.BadName:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class vcs_gitsvn(vcs):
|
class vcs_gitsvn(vcs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue