diff options
author | Shawn O. Pearce <sop@google.com> | 2009-07-03 15:22:49 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-07-03 16:39:19 -0700 |
commit | 1875ddd47c0bf38e5cc52e1e5875caabce2d8742 (patch) | |
tree | cfa269cd610a1e569cd3b3b5e0d3a92675d74a7d /subcmds/sync.py | |
parent | 446c4e5556a4c85621d61b3aba63d084300c6224 (diff) | |
download | git-repo-1875ddd47c0bf38e5cc52e1e5875caabce2d8742.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>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index afd44dab..1537c9a2 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -118,6 +118,8 @@ later is required to fix a server side protocol bug. | |||
118 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name | 118 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name |
119 | sys.exit(1) | 119 | sys.exit(1) |
120 | pm.end() | 120 | pm.end() |
121 | for project in projects: | ||
122 | project.bare_git.gc('--auto') | ||
121 | return fetched | 123 | return fetched |
122 | 124 | ||
123 | def UpdateProjectList(self): | 125 | def UpdateProjectList(self): |