ci_template: Use git diff --quiet for checking for changes
Checking the exit code of git diff --quiet is preferred over looking whether git diff produces any output.
This commit is contained in:
parent
5b664cd00f
commit
4493ab0bb8
@ -46,12 +46,12 @@ gst indent:
|
||||
- chmod +x gst-indent
|
||||
- find . -name '*.c' -exec ./gst-indent {} +
|
||||
- |
|
||||
if [[ $(git diff) ]]; then
|
||||
if git diff --quiet; then
|
||||
echo "Code is properly formatted"
|
||||
else
|
||||
git diff --color=always
|
||||
echo 'style diverges, please run gst-indent first'
|
||||
exit 1
|
||||
else
|
||||
echo "Code is properly formatted"
|
||||
fi
|
||||
except:
|
||||
variables:
|
||||
|
Loading…
x
Reference in New Issue
Block a user