From 0578ebf61a6269e4045153c7d618baebaf00d869 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 27 Aug 2020 01:50:12 -0400 Subject: 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 Tested-by: Mike Frysinger --- subcmds/init.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index eb82e2e4..41578076 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -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): -- cgit v1.2.3-54-g00ecf