Don't fetch tags when using --no-history.

After the initial gclient sync, "fetch --no-history" was adding a
fetchspec to the config for the main repository that causes all tags to
be downloaded in future. This means that after fetching a repository
with no history, the very next git pull (or other remote update
operation) will download all the tags, including all the history
referred to by those tags, leaving you with an almost-complete checkout
of the top-level repository that takes up much more space.

Fix this by skipping the "git config" command that requests the tags
when using no-history.

Change-Id: Ia31baa6a90df014ebc1e8c2ed6e05de3ad27d415
Reviewed-on: https://chromium-review.googlesource.com/909653
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
changes/53/909653/2
Torne (Richard Coles) 8 years ago committed by Commit Bot
parent 71236c3af6
commit 08ca04b2b2

@ -144,9 +144,10 @@ class GclientGitCheckout(GclientCheckout, GitCheckout):
'submodule', 'foreach',
'git config -f $toplevel/.git/config submodule.$name.ignore all',
cwd=wd)
self.run_git(
'config', '--add', 'remote.origin.fetch',
'+refs/tags/*:refs/tags/*', cwd=wd)
if not self.options.no_history:
self.run_git(
'config', '--add', 'remote.origin.fetch',
'+refs/tags/*:refs/tags/*', cwd=wd)
self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd)

Loading…
Cancel
Save