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

Merge branch 'fix_getref' into 'master'

git.getref: use python-git

See merge request fdroid/fdroidserver!1186
This commit is contained in:
Michael Pöhn 2022-09-14 09:25:28 +00:00
commit 5e31f23a96

View File

@ -1252,12 +1252,10 @@ class vcs_git(vcs):
def getref(self, revname='HEAD'):
self.checkrepo()
p = FDroidPopen(['git', 'rev-parse', '--verify',
'{revname}^{{commit}}'.format(revname=revname)], cwd=self.local,
output=False)
if p.returncode != 0:
repo = git.Repo(self.local)
if not repo.is_valid_object(revname):
return None
return p.output.strip()
return repo.commit(revname).hexsha
class vcs_gitsvn(vcs):