From 74d4731da1fd61e3705e808bcd496979ef8ddf5a Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 13 Aug 2018 15:42:34 -0700 Subject: submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree e98317508c0 (submodule: ensure core.worktree is set after update, 2018-06-18) was overly aggressive in calling connect_work_tree_and_git_dir as that ensures both the 'core.worktree' configuration is set as well as setting up correct gitlink file pointing at the git directory. We do not need to check for the gitlink in this part of the cmd_update in git-submodule.sh, as the initial call to update-clone will have ensured that. So we can reduce the work to only (check and potentially) set the 'core.worktree' setting. While at it move the check from shell to C as that proves to be useful in a follow up patch, as we do not need the 'name' in shell now. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- git-submodule.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index 8caaf274e2..19d010eac0 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -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 -- cgit v1.3