mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-19 03:30:12 +02:00
git.getref: use python-git
Fixes a "warning: refname is ambiguous." problem:
$ git clone https://gitlab.com/joshua.tee/wx.git
$ cd wx
$ git rev-parse 55699
warning: refname '55699' is ambiguous.
8760bb0ce7 (note_1090707468)
This commit is contained in:
parent
7aa4b2678b
commit
7b31535c25
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user