X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-submodule.sh;h=c7f58c5756f7b6f78689d574c5a2177d1bd409b5;hb=3dc47c428894c0eca7b01561978befdc09f64e48;hp=e3c054bde5f1d6fb858071ba7bf2939253811e1f;hpb=061ed420ec2dc97e2a922a6f02992869089cefb3;p=thirdparty%2Fgit.git diff --git a/git-submodule.sh b/git-submodule.sh index e3c054bde5..c7f58c5756 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -232,6 +232,13 @@ cmd_add() die "$(eval_gettext "'\$sm_path' already exists in the index and is not a submodule")" fi + if test -d "$sm_path" && + test -z $(git -C "$sm_path" rev-parse --show-cdup 2>/dev/null) + then + git -C "$sm_path" rev-parse --verify -q HEAD >/dev/null || + die "$(eval_gettext "'\$sm_path' does not have a commit checked out")" + fi + if test -z "$force" && ! git add --dry-run --ignore-missing --no-warn-embedded-repo "$sm_path" > /dev/null 2>&1 then