sync: Do a git pull with --use-superproject if superproject tree already exists.

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: I7e4b1e51ca1d18b836a5fa8d139a0765262ba500
This commit is contained in:
Raman Tenneti
2021-02-01 11:15:16 -08:00
parent 9e7875315f
commit 7caa3658b2
2 changed files with 8 additions and 1 deletions

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, '--filter', 'blob:none']
cmd = ['clone', url, '--depth', '1']
if branch:
cmd += ['--branch', branch]
p = GitCommand(None,