mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-19 12:34:17 +00:00
init: reject unknown args
If you pass args to `repo init` when first creating a checkout, the repo launcher throws an error. But the init subcommand that runs in an existing checkout silently ignores them. Throw a proper error. Change-Id: I433bfcc73902d25f6b6a2974e77f6a977a75ed16 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/279696 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
@ -488,6 +488,9 @@ to update the working directory files.
|
||||
if opt.archive and opt.mirror:
|
||||
self.OptionParser.error('--mirror and --archive cannot be used together.')
|
||||
|
||||
if args:
|
||||
self.OptionParser.error('init takes no arguments')
|
||||
|
||||
def Execute(self, opt, args):
|
||||
git_require(MIN_GIT_VERSION_HARD, fail=True)
|
||||
if not git_require(MIN_GIT_VERSION_SOFT):
|
||||
|
Reference in New Issue
Block a user