summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Neus <jackneus@google.com>2021-10-11 18:14:35 +0000
committerJack Neus <jackneus@google.com>2021-10-11 18:58:11 +0000
commit0f6f16ed1784049a11be5be364879affe35ff921 (patch)
tree5eb881ef183459db9160a6f69e8747838bc59ed4
parent76491590b890e5be70bd17996c12ff2a8fe1e218 (diff)
downloadgit-repo-0f6f16ed1784049a11be5be364879affe35ff921.tar.gz
repo: more arg checking for --standalone-manifest re-initsv2.17.1
`repo init` doesn't do anything on re-init when the checkout has been initialized using --standalone manifest. Rather than let the tool run through its existing flows (which happen to noop), check the args and explicitly quit if a bare `repo init` is run on a standalone checkout. BUG=none TEST=manual tests Change-Id: Ie4346ef6df1282ec3e3f8045a08138c93653fece Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320735 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
-rw-r--r--subcmds/init.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index 53c6ba04..853cbe68 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -127,6 +127,11 @@ to update the working directory files.
127 # anew. 127 # anew.
128 if not is_new: 128 if not is_new:
129 was_standalone_manifest = m.config.GetString('manifest.standalone') 129 was_standalone_manifest = m.config.GetString('manifest.standalone')
130 if was_standalone_manifest and not opt.manifest_url:
131 print('fatal: repo was initialized with a standlone manifest, '
132 'cannot be re-initialized without --manifest-url/-u')
133 sys.exit(1)
134
130 if opt.standalone_manifest or ( 135 if opt.standalone_manifest or (
131 was_standalone_manifest and opt.manifest_url): 136 was_standalone_manifest and opt.manifest_url):
132 m.config.ClearCache() 137 m.config.ClearCache()