From 0f2e45a3a69e9a99d91ed26768b82e3454aa8630 Mon Sep 17 00:00:00 2001 From: Akshay Verma Date: Sat, 24 Mar 2018 12:27:05 +0530 Subject: Pass refs to ls-remote This will fix the issue of parsing large output locally Change-Id: I9a5cf1238147a02c92a3fca53eab9bd57f9d16b4 --- subcmds/download.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'subcmds/download.py') diff --git a/subcmds/download.py b/subcmds/download.py index 384af781..dba70ffd 100755 --- a/subcmds/download.py +++ b/subcmds/download.py @@ -62,9 +62,10 @@ If no project is specified try to use current directory as a project. ps_id = int(m.group(2)) else: ps_id = 1 - regex = r'refs/changes/%2.2d/%d/(\d+)' % (chg_id % 100, chg_id) - output = project._LsRemote() + refs = 'refs/changes/%2.2d/%d/' % (chg_id % 100, chg_id) + output = project._LsRemote(refs + '*') if output: + regex = refs + r'(\d+)' rcomp = re.compile(regex, re.I) for line in output.splitlines(): match = rcomp.search(line) -- cgit v1.2.3-54-g00ecf