sync: Added --filter=blob:none for git clone of superproject.

+ This is without --depth option. This is done for reachability.
  Server doesn't know what you know about in the history so it always
  sends you the whole thing Which is very slow.

  If we have the full history it can send you incremental update history
  which is very small and fast.

Tested the code with the following commands.

$ ./run_tests -v tests/test_git_superproject.py
$ ./run_tests -v

Tested the sync code by copying all the repo changes into my Android
AOSP checkout and doing a repo sync --use-superproject twice.

.../WORKING_DIRECTORY$ repo sync --use-superproject

Bug: https://crbug.com/gerrit/13709
Bug: https://crbug.com/gerrit/13707
Tested-by: Raman Tenneti <rtenneti@google.com>
Change-Id: I239de6d8f1c2ed6b4c69e7a78b8aa95338fa838c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/295362
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Raman Tenneti 2021-02-01 12:37:35 -08:00
parent 7caa3658b2
commit ef267722f8

View File

@ -63,7 +63,7 @@ class Superproject(object):
True if 'git clone <url> <branch>' is successful, or False.
"""
os.mkdir(self._superproject_path)
cmd = ['clone', url, '--depth', '1']
cmd = ['clone', url, '--filter', 'blob:none']
if branch:
cmd += ['--branch', branch]
p = GitCommand(None,