]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(submodules/remove): Find `.git` dir
authorOleg Broytman <phd@phdru.name>
Sun, 5 Mar 2023 13:16:25 +0000 (16:16 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 5 Mar 2023 13:16:25 +0000 (16:16 +0300)
In case of a submodule `.git` is a file, not a directory.
Find the `.git` dir in the superproject's `.git/`.

submodules/remove

index f8d6d9452ab4d2a1c898799bbaffb475b8c76ce4..23af550b9c80f65643013f1ae08a39e46081b8ff 100755 (executable)
@@ -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"