git: only list heads and tags references

When looking for git source references, we only need the heads.
This reduce the load of using https://opendev.org/zuul/zuul-jobs
which now contains all the gerrit refs.

Change-Id: I72532592312062dee17f095f3d56866d16e429dc
This commit is contained in:
Tristan Cacqueray 2019-05-24 05:41:45 +00:00
parent af910d9d8e
commit ef69d2a6d8
1 changed files with 1 additions and 0 deletions

View File

@ -184,6 +184,7 @@ class GitConnection(BaseConnection):
refs = {}
client = git.cmd.Git()
output = client.ls_remote(
"--heads", "--tags",
os.path.join(self.baseurl, project))
for line in output.splitlines():
sha, ref = line.split('\t')