summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-04-26 14:06:49 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2022-10-27 11:54:37 +0100
commitdd84a906e061550daaedea6ce88762f1839253ab (patch)
treef0115aa9d7e8d65620e29ca59528d49bd3bbc9fa /scripts
parent73422d9524376526ab5950b3be3098901cd605d6 (diff)
downloadfocaccia-qemu-dd84a906e061550daaedea6ce88762f1839253ab.tar.gz
focaccia-qemu-dd84a906e061550daaedea6ce88762f1839253ab.zip
scripts: check if .git exists before checking submodule status
Currently we check status of each submodule, before actually checking
if we're in a git repo. These status commands will all fail, but we
are hiding their output so we don't see it currently.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git-submodule.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index e225d3a963..7be41f5948 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -51,6 +51,12 @@ validate_error() {
     exit 1
 }
 
+if test -n "$maybe_modules" && ! test -e ".git"
+then
+    echo "$0: unexpectedly called with submodules but no git checkout exists"
+    exit 1
+fi
+
 modules=""
 for m in $maybe_modules
 do
@@ -63,12 +69,6 @@ do
     fi
 done
 
-if test -n "$maybe_modules" && ! test -e ".git"
-then
-    echo "$0: unexpectedly called with submodules but no git checkout exists"
-    exit 1
-fi
-
 case "$command" in
 status|validate)
     if test -z "$maybe_modules"