From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH] scripts: check if .git exists before checking submodule status
Date: Wed, 29 Jun 2022 17:08:57 +0100 [thread overview]
Message-ID: <20220629160857.425400-1-berrange@redhat.com> (raw)
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.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
scripts/git-submodule.sh | 12 ++++++------
1 file 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"
--
2.36.1
next reply other threads:[~2022-06-29 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 16:08 Daniel P. Berrangé [this message]
2022-07-01 1:39 ` [PATCH] scripts: check if .git exists before checking submodule status Richard Henderson
2022-07-06 21:13 ` Philippe Mathieu-Daudé via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220629160857.425400-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).