Skip to content

Commit 736d9f1

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 42a8c5c commit 736d9f1

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
@@ -191,6 +191,10 @@ static int module_clone(int argc, const char **argv, const char *prefix)
191191
if (!path || !*path)
192192
die(_("submodule--helper: unspecified or empty --path"));
193193

194+
if (argc)
195+
usage_with_options(git_submodule_helper_usage,
196+
module_clone_options);
197+
194198
strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name);
195199
sm_gitdir = xstrdup(absolute_path(sb.buf));
196200
strbuf_reset(&sb);

0 commit comments

Comments
 (0)