From: Jacob Keller Date: Mon, 29 Feb 2016 22:58:31 +0000 (-0800) Subject: submodule: check argc count for git submodule--helper clone X-Git-Tag: v2.9.0-rc0~147^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08e0970a862aaa3b42c532ad0086bcaabe5108cf;p=git submodule: check argc count for git submodule--helper clone Extra unused arguments to git submodule--helper clone subcommand were being silently ignored. Add a check to the argc count after options handling to ensure that no extra arguments were left on the argv array. Signed-off-by: Jacob Keller Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index f4c3eff179..1e18075ed9 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -194,6 +194,10 @@ static int module_clone(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, module_clone_options, git_submodule_helper_usage, 0); + if (argc) + usage_with_options(git_submodule_helper_usage, + module_clone_options); + strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name); sm_gitdir = strbuf_detach(&sb, NULL);