t/helper: add test-submodule-nested-repo-config
[gitweb.git] / git-submodule.sh
index 25b9bc58cb8e20e5eb55e3e758c28e4e55df17f7..bff855f54adf9674ddcc7b8213d103d56788f9e6 100755 (executable)
@@ -159,6 +159,11 @@ cmd_add()
                shift
        done
 
+       if ! git submodule--helper config --check-writeable >/dev/null 2>&1
+       then
+                die "$(eval_gettext "please make sure that the .gitmodules file is in the working tree")"
+       fi
+
        if test -n "$reference_path"
        then
                is_absolute_path "$reference_path" ||