summaryrefslogtreecommitdiffstats
path: root/git_refs.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-17 20:58:02 -0700
committerShawn O. Pearce <sop@google.com>2009-04-17 21:03:45 -0700
commitfbcde472cadfc8319016faca90cb5b57f7a00ee4 (patch)
treeee0b2eb641c2874f5d150d0e5b1556778e308b42 /git_refs.py
parentd237b698652120f4d859b6f9e12e3aa15aa7b2d5 (diff)
downloadgit-repo-fbcde472cadfc8319016faca90cb5b57f7a00ee4.tar.gz
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>
Diffstat (limited to 'git_refs.py')
-rw-r--r--git_refs.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/git_refs.py b/git_refs.py
index 9851e78b..eefa2abe 100644
--- a/git_refs.py
+++ b/git_refs.py
@@ -41,6 +41,17 @@ class GitRefs(object):
41 except KeyError: 41 except KeyError:
42 return '' 42 return ''
43 43
44 def deleted(self, name):
45 if self._phyref is not None:
46 if name in self._phyref:
47 del self._phyref[name]
48
49 if name in self._symref:
50 del self._symref[name]
51
52 if name in self._mtime:
53 del self._mtime[name]
54
44 def _NeedUpdate(self): 55 def _NeedUpdate(self):
45 for name, mtime in self._mtime.iteritems(): 56 for name, mtime in self._mtime.iteritems():
46 try: 57 try: