submodule: fix segmentation fault in submodule--helper clone
[gitweb.git] / builtin / submodule--helper.c
index 3c4d3ff7f4af6874f9ab9004bedb8690f3c4ac72..35ae85a7e1bcc3d3d12f36cae439f7fbf98d8a4a 100644 (file)
@@ -186,15 +186,15 @@ static int module_clone(int argc, const char **argv, const char *prefix)
 
        const char *const git_submodule_helper_usage[] = {
                N_("git submodule--helper clone [--prefix=<path>] [--quiet] "
-                  "[--reference <repository>] [--name <name>] [--url <url>]"
-                  "[--depth <depth>] [--path <path>]"),
+                  "[--reference <repository>] [--name <name>] [--depth <depth>] "
+                  "--url <url> --path <path>"),
                NULL
        };
 
        argc = parse_options(argc, argv, prefix, module_clone_options,
                             git_submodule_helper_usage, 0);
 
-       if (argc)
+       if (argc || !url || !path)
                usage_with_options(git_submodule_helper_usage,
                                   module_clone_options);