diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-04-02 10:55:33 -0700 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-04-05 05:53:19 +0000 |
commit | 6a2f4fb39073a4e2e6824d5f2f4a1cbf5fe4b766 (patch) | |
tree | 039174f3558762b8152d3621ea0f6dcf0c70ee65 /subcmds/init.py | |
parent | beea5de84297518634de48b20961efa68a57d797 (diff) | |
download | git-repo-6a2f4fb39073a4e2e6824d5f2f4a1cbf5fe4b766.tar.gz |
repo init: Added --no-partial-clone and made it persist. Bumped version to 2.14.
Saved the repo.partialclone when --no-partial-clone option is passed
to init, so repo sync will honor the no-partial-clone option.
$ ./run_tests -v
Bug: [google internal] b/175712967
$ mkdir androidx-main && cd androidx-main
$ repo init -u https://android.googlesource.com/platform/manifest -b androidx-main --partial-clone --clone-filter=blob:limit=10M
$ repo sync -c -j32
$ cd frameworks/support/ && /google/bin/releases/android/git_repack/git_unpartial
$ git config -l | grep 'partialclonefilter=blob'
Observe partialclone is not enabled.
$ cd ../..
$ repo init -u https://android.googlesource.com/platform/manifest -b androidx-main
$ repo sync -c -j32
$ cd frameworks/support/ && git config -l | grep 'partialclonefilter=blob'
Observe partialclone is enabled.
$ /google/bin/releases/android/git_repack/git_unpartial
Observe partialclone is not enabled.
$ cd ../..
$ repo_dev init -u https://android.googlesource.com/platform/manifest -b androidx-main --no-partial-clone
$ repo sync -c -j32
$ cd frameworks/support/ && git config -l | grep 'partialclonefilter=blob'
Observe partialclone is not enabled.
Change-Id: I4400ad7803b106319856bcd0fffe00bafcdf014e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/302122
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'subcmds/init.py')
-rw-r--r-- | subcmds/init.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 86b77742..f16bee6d 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -124,6 +124,10 @@ to update the working directory files. | |||
124 | dest='partial_clone', | 124 | dest='partial_clone', |
125 | help='perform partial clone (https://git-scm.com/' | 125 | help='perform partial clone (https://git-scm.com/' |
126 | 'docs/gitrepository-layout#_code_partialclone_code)') | 126 | 'docs/gitrepository-layout#_code_partialclone_code)') |
127 | g.add_option('--no-partial-clone', action='store_false', | ||
128 | dest='partial_clone', | ||
129 | help='disable use of partial clone (https://git-scm.com/' | ||
130 | 'docs/gitrepository-layout#_code_partialclone_code)') | ||
127 | g.add_option('--clone-filter', action='store', default='blob:none', | 131 | g.add_option('--clone-filter', action='store', default='blob:none', |
128 | dest='clone_filter', | 132 | dest='clone_filter', |
129 | help='filter for use with --partial-clone [default: %default]') | 133 | help='filter for use with --partial-clone [default: %default]') |
@@ -311,7 +315,7 @@ to update the working directory files. | |||
311 | 'in another location.', file=sys.stderr) | 315 | 'in another location.', file=sys.stderr) |
312 | sys.exit(1) | 316 | sys.exit(1) |
313 | 317 | ||
314 | if opt.partial_clone: | 318 | if opt.partial_clone is not None: |
315 | if opt.mirror: | 319 | if opt.mirror: |
316 | print('fatal: --mirror and --partial-clone are mutually exclusive', | 320 | print('fatal: --mirror and --partial-clone are mutually exclusive', |
317 | file=sys.stderr) | 321 | file=sys.stderr) |
@@ -319,6 +323,8 @@ to update the working directory files. | |||
319 | m.config.SetBoolean('repo.partialclone', opt.partial_clone) | 323 | m.config.SetBoolean('repo.partialclone', opt.partial_clone) |
320 | if opt.clone_filter: | 324 | if opt.clone_filter: |
321 | m.config.SetString('repo.clonefilter', opt.clone_filter) | 325 | m.config.SetString('repo.clonefilter', opt.clone_filter) |
326 | elif m.config.GetBoolean('repo.partialclone'): | ||
327 | opt.clone_filter = m.config.GetString('repo.clonefilter') | ||
322 | else: | 328 | else: |
323 | opt.clone_filter = None | 329 | opt.clone_filter = None |
324 | 330 | ||