mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
Improve repo sync performance by avoid git forks
By resolving the current HEAD and the manifest revision using pure Python, we can in the common case of "no changes" avoid a lot of git operations and directly jump out of the local sync method. This reduces the no-op `repo sync -l` time for Android's 114 projects from more than 6s to under 0.8s. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
11
git_refs.py
11
git_refs.py
@ -41,6 +41,17 @@ class GitRefs(object):
|
||||
except KeyError:
|
||||
return ''
|
||||
|
||||
def deleted(self, name):
|
||||
if self._phyref is not None:
|
||||
if name in self._phyref:
|
||||
del self._phyref[name]
|
||||
|
||||
if name in self._symref:
|
||||
del self._symref[name]
|
||||
|
||||
if name in self._mtime:
|
||||
del self._mtime[name]
|
||||
|
||||
def _NeedUpdate(self):
|
||||
for name, mtime in self._mtime.iteritems():
|
||||
try:
|
||||
|
Reference in New Issue
Block a user