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>
This commit is contained in:
parent
73422d9524
commit
dd84a906e0
@ -51,6 +51,12 @@ validate_error() {
|
|||||||
exit 1
|
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=""
|
modules=""
|
||||||
for m in $maybe_modules
|
for m in $maybe_modules
|
||||||
do
|
do
|
||||||
@ -63,12 +69,6 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
case "$command" in
|
||||||
status|validate)
|
status|validate)
|
||||||
if test -z "$maybe_modules"
|
if test -z "$maybe_modules"
|
||||||
|
Loading…
Reference in New Issue
Block a user