Skip to content

Commit a7e2546

Browse files
jacob-kellerdscho
authored andcommitted
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 <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 840c875 commit a7e2546

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builtin/submodule--helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ static int module_clone(int argc, const char **argv, const char *prefix)
515515
usage_with_options(git_submodule_helper_usage,
516516
module_clone_options);
517517

518+
if (argc)
519+
usage_with_options(git_submodule_helper_usage,
520+
module_clone_options);
521+
518522
strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name);
519523
sm_gitdir = xstrdup(absolute_path(sb.buf));
520524
strbuf_reset(&sb);

0 commit comments

Comments
 (0)