submodule: ensure core.worktree is set after update
[gitweb.git] / git-submodule.sh
index 78073cd87d1b1775bb4f4264557aba18c73c5911..6bd0db02b331291cf3acd60cf66bc1abc7844368 100755 (executable)
@@ -615,6 +615,11 @@ cmd_update()
                        die "$(eval_gettext "Unable to find current \${remote_name}/\${branch} revision in submodule path '\$sm_path'")"
                fi
 
+               if ! $(git config -f "$(git rev-parse --git-common-dir)/modules/$name/config" core.worktree) 2>/dev/null
+               then
+                       git submodule--helper connect-gitdir-workingtree "$name" "$sm_path"
+               fi
+
                if test "$subsha1" != "$sha1" || test -n "$force"
                then
                        subforce=$force