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:
commit
5e31f23a96
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user