submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree
[gitweb.git] / git-submodule.sh
index 8caaf274e25296e18218f55273cefda5bd7777fd..19d010eac069a043dd97754f51c6c98fc6e1079a 100755 (executable)
@@ -535,6 +535,8 @@ cmd_update()
        do
                die_if_unmatched "$quickabort" "$sha1"
 
+               git submodule--helper ensure-core-worktree "$sm_path"
+
                name=$(git submodule--helper name "$sm_path") || exit
                if ! test -z "$update"
                then
@@ -577,11 +579,6 @@ 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