scripts/format-code.sh: Immediately exit on bad exit status

Shell scripts exit with the exit status of the last command if `set -e`
is not in use. Adding code to the end of the script to support the local
format-code.sh meant that `git --no-pager diff --exit-code` was not
necessarily the last command to be executed by the script, and therefore
the script's exit code did not necessarily reflect the presence of badly
formatted code.

Fixes openbmc/openbmc#3125

Change-Id: Icefad5b81b420c364022075face7c4027d8af4e6
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
1 file changed