summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2016-02-29 22:58:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-01 20:24:03 (GMT)
commit08e0970a862aaa3b42c532ad0086bcaabe5108cf (patch)
treeaae617b663d02b02448fc87ea1dabc17cd1eefc5 /builtin/submodule--helper.c
parentd10e3b4260628fbe07117e2b57003291500e4f47 (diff)
downloadgit-08e0970a862aaa3b42c532ad0086bcaabe5108cf.zip
git-08e0970a862aaa3b42c532ad0086bcaabe5108cf.tar.gz
git-08e0970a862aaa3b42c532ad0086bcaabe5108cf.tar.bz2
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 <jacob.keller@gmail.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index f4c3eff..1e18075 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);