submodule.c: report the submodule that an error occurs in
[gitweb.git] / git-submodule.sh
index 156255a9e56e7a5930f3f652ee38994064db03ea..f2e5bea715c3b184b98958c763f5ba9917a996ad 100755 (executable)
@@ -229,6 +229,11 @@ Use -f if you really want to add it." >&2
                sm_name="$sm_path"
        fi
 
+       if ! git submodule--helper check-name "$sm_name"
+       then
+               die "$(eval_gettext "'$sm_name' is not a valid submodule name")"
+       fi
+
        # perhaps the path exists and is already a git repo, else clone it
        if test -e "$sm_path"
        then