summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrepo5
-rw-r--r--subcmds/init.py8
2 files changed, 11 insertions, 2 deletions
diff --git a/repo b/repo
index 768050ea..80db98d2 100755
--- a/repo
+++ b/repo
@@ -147,7 +147,7 @@ if not REPO_REV:
147 REPO_REV = 'stable' 147 REPO_REV = 'stable'
148 148
149# increment this whenever we make important changes to this script 149# increment this whenever we make important changes to this script
150VERSION = (2, 12) 150VERSION = (2, 14)
151 151
152# increment this if the MAINTAINER_KEYS block is modified 152# increment this if the MAINTAINER_KEYS block is modified
153KEYRING_VERSION = (2, 3) 153KEYRING_VERSION = (2, 3)
@@ -314,6 +314,9 @@ def GetParser(gitc_init=False):
314 group.add_option('--partial-clone', action='store_true', 314 group.add_option('--partial-clone', action='store_true',
315 help='perform partial clone (https://git-scm.com/' 315 help='perform partial clone (https://git-scm.com/'
316 'docs/gitrepository-layout#_code_partialclone_code)') 316 'docs/gitrepository-layout#_code_partialclone_code)')
317 group.add_option('--no-partial-clone', action='store_false',
318 help='disable use of partial clone (https://git-scm.com/'
319 'docs/gitrepository-layout#_code_partialclone_code)')
317 group.add_option('--clone-filter', action='store', default='blob:none', 320 group.add_option('--clone-filter', action='store', default='blob:none',
318 help='filter for use with --partial-clone ' 321 help='filter for use with --partial-clone '
319 '[default: %default]') 322 '[default: %default]')
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