X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=submodules%2Fremove;h=90cb02f6fc10904725a88f461df2c99902706bea;hb=684b1b0977c20fe1ffe172fc080854adc8031681;hp=f8d6d9452ab4d2a1c898799bbaffb475b8c76ce4;hpb=f9a2c7f20a7df079c05e27680f4d6ce87f5a27c8;p=git-scripts.git diff --git a/submodules/remove b/submodules/remove index f8d6d94..90cb02f 100755 --- a/submodules/remove +++ b/submodules/remove @@ -8,8 +8,8 @@ fi cd "`git rev-parse --show-toplevel`" || exit 1 if [ \! -f .gitmodules ]; then - echo "The command must be run in the top-level directory" >&2 - echo "of a repository with submodules" >&2 + echo "Cannot find .gitmodules. The command must be run " >&2 + echo "in the top-level directory of a repository with submodules" >&2 exit 1 fi @@ -21,6 +21,6 @@ if [ -z "$path" ]; then exit 1 fi -git rm "$path" -rm -rf .git/modules/"$name" +git rm "$path" && +rm -rf "`git rev-parse --git-dir`"/modules/"$name" && exec git config --remove-section submodule."$name"