From 66080b4b28aae81d5b3c285cee1efe25c2af303d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 17 Apr 2016 21:30:38 +0200 Subject: [PATCH] Make submodule check smarter --- Tools/check_submodules.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/check_submodules.sh b/Tools/check_submodules.sh index 4d3c05db9b..93b9f9a460 100755 --- a/Tools/check_submodules.sh +++ b/Tools/check_submodules.sh @@ -12,8 +12,8 @@ GITSTATUS=$(git status) function check_git_submodule { # The .git exists in a submodule if init and update have been done. -if [ -f $1"/.git" ]; - then +if [ -f $1"/.git" ] || [ -d $1"/.git" ]; +then SUBMODULE_STATUS=$(git submodule summary "$1") STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1") if ! [[ -z "$STATUSRETVAL" ]]; @@ -54,6 +54,8 @@ if [ -f $1"/.git" ]; fi fi else + echo "REINITIALIZING GIT SUBMODULES" + echo "no git repo found in $1/.git" git submodule sync --recursive; git submodule update --init --recursive $1; fi