]> git.proxmox.com Git - mirror_qemu.git/commitdiff
scripts: check if .git exists before checking submodule status
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Apr 2022 13:06:49 +0000 (14:06 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 27 Oct 2022 10:54:37 +0000 (11:54 +0100)
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>
scripts/git-submodule.sh

index e225d3a9634447ea2b2915ec3cb19376101d8a56..7be41f594832eccf711140cdbd6f7c3e65b3e04d 100755 (executable)
@@ -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"