Commit 08ca04b2 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Commit Bot

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/909653Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
parent 71236c3a
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment