mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
project.py: fix performance issue with --reference when the mirrored repository has many refs
Change-Id: Id0183903597f872eee80ca32a8050125b187a3d4
This commit is contained in:
parent
ffb4b89099
commit
3d7bbc9edf
10
project.py
10
project.py
@ -1963,15 +1963,17 @@ class Project(object):
|
|||||||
ids.add(ref_id)
|
ids.add(ref_id)
|
||||||
tmp.add(r)
|
tmp.add(r)
|
||||||
|
|
||||||
tmp_packed = ''
|
tmp_packed_lines = []
|
||||||
old_packed = ''
|
old_packed_lines = []
|
||||||
|
|
||||||
for r in sorted(all_refs):
|
for r in sorted(all_refs):
|
||||||
line = '%s %s\n' % (all_refs[r], r)
|
line = '%s %s\n' % (all_refs[r], r)
|
||||||
tmp_packed += line
|
tmp_packed_lines.append(line)
|
||||||
if r not in tmp:
|
if r not in tmp:
|
||||||
old_packed += line
|
old_packed_lines.append(line)
|
||||||
|
|
||||||
|
tmp_packed = ''.join(tmp_packed_lines)
|
||||||
|
old_packed = ''.join(old_packed_lines)
|
||||||
_lwrite(packed_refs, tmp_packed)
|
_lwrite(packed_refs, tmp_packed)
|
||||||
else:
|
else:
|
||||||
alt_dir = None
|
alt_dir = None
|
||||||
|
Loading…
Reference in New Issue
Block a user