mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40: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'):
|
||||
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