1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50: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'): def getref(self, revname='HEAD'):
self.checkrepo() self.checkrepo()
p = FDroidPopen(['git', 'rev-parse', '--verify', repo = git.Repo(self.local)
'{revname}^{{commit}}'.format(revname=revname)], cwd=self.local, if not repo.is_valid_object(revname):
output=False)
if p.returncode != 0:
return None return None
return p.output.strip() return repo.commit(revname).hexsha
class vcs_gitsvn(vcs): class vcs_gitsvn(vcs):