From: Brandon Williams Date: Thu, 09 Mar 2017 01:23:37 GMT Subject: [PATCH v2 03/11] submodule deinit: use most reliable url Message-ID: <20170309012345.180702-4-bmwill@google.com> In-Reply-To: <20170309012345.180702-1-bmwill@google.com> The user could have configured the submodule to have a different URL from the one in the superproject's config. To account for this read what the submodule has configured for remote.origin.url and use that instead. Signed-off-by: Brandon Williams --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 19660b9c0..1c2064cc1 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -455,7 +455,7 @@ Submodule work tree '\$displaypath' contains a .git directory then # Remove the whole section so we have a clean state when # the user later decides to init this submodule again - url=$(git config submodule."$name".url) + url=$(GIT_DIR="$(git rev-parse --git-path modules/$name)" git config remote.origin.url) git config --remove-section submodule."$name" 2>/dev/null && say "$(eval_gettext "Submodule '\$name' (\$url) unregistered for path '\$displaypath'")" fi -- 2.12.0.246.ga2ecc84866-goog