Commit 6021fbd0 by Nicolas Capens Committed by Nicolas Capens

Fix commit message validation reporting

"set -e" was aborting the script after grep doesn't find the Bug line, and "set -x" makes things overly verbose. So perform the validation before these options are set. Also return 1 instead of 0 on failure. Bug: b/141892461 Change-Id: Ica0364ff49383b47cf37b3a02d6b03e55d8d88ad Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37008 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 99938eab
#!/bin/bash #!/bin/bash
# Fail on any error.
set -e
# Display commands being run.
set -x
cd git/SwiftShader cd git/SwiftShader
# Validate commit message # Validate commit message
...@@ -12,10 +7,15 @@ git log -1 --pretty=%B | grep -E '^Bug:|^Issue:|^Regres:' ...@@ -12,10 +7,15 @@ git log -1 --pretty=%B | grep -E '^Bug:|^Issue:|^Regres:'
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Commit message must have a Bug: line." echo "error: Git commit message must have a Bug: line."
exit 0 exit 1
fi fi
# Fail on any error.
set -e
# Display commands being run.
set -x
# Download all submodules # Download all submodules
git submodule update --init git submodule update --init
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment