summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-07-03 15:22:49 -0700
committerShawn O. Pearce <sop@google.com>2011-01-09 17:39:22 -0800
commit0d2b61f11d0501fcf1e5a1c19f18dac03e0b09bc (patch)
treea0be431dc8225690610c741e8d62b7f09185845d /subcmds/sync.py
parent2bf9db0d3b0b4cf4e11187ea7438ddeb1262fe21 (diff)
downloadgit-repo-0d2b61f11d0501fcf1e5a1c19f18dac03e0b09bc.tar.gz
sync: Run `git gc --auto` after fetch
Users may wind up with a lot of loose object content in projects they don't frequently make changes in, but that are modified by others. Since we bypass many git code paths that would have otherwise called out to `git gc --auto`, its possible for these projects to have their loose object database grow out of control. To help prevent that, we now invoke it ourselves during the network half of sync. Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit 1875ddd47c0bf38e5cc52e1e5875caabce2d8742)
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 80bba1aa..36ef16db 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -185,6 +185,8 @@ later is required to fix a server side protocol bug.
185 t.join() 185 t.join()
186 186
187 pm.end() 187 pm.end()
188 for project in projects:
189 project.bare_git.gc('--auto')
188 return fetched 190 return fetched
189 191
190 def UpdateProjectList(self): 192 def UpdateProjectList(self):