From: Oleg Broytman Date: Sun, 5 Mar 2023 13:16:25 +0000 (+0300) Subject: Feat(submodules/remove): Find `.git` dir X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=2c8b9c04b057a672f2a1768e389ba24b9f0a6c0e Feat(submodules/remove): Find `.git` dir In case of a submodule `.git` is a file, not a directory. Find the `.git` dir in the superproject's `.git/`. --- diff --git a/submodules/remove b/submodules/remove index f8d6d94..23af550 100755 --- a/submodules/remove +++ b/submodules/remove @@ -22,5 +22,5 @@ if [ -z "$path" ]; then fi git rm "$path" -rm -rf .git/modules/"$name" +rm -rf "git rev-parse --git-dir"/modules/"$name" exec git config --remove-section submodule."$name"