summaryrefslogtreecommitdiffstats
path: root/ci/check-whitespace.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/check-whitespace.sh')
-rwxr-xr-xci/check-whitespace.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/ci/check-whitespace.sh b/ci/check-whitespace.sh
index db399097a5..c40804394c 100755
--- a/ci/check-whitespace.sh
+++ b/ci/check-whitespace.sh
@@ -9,7 +9,7 @@ baseCommit=$1
outputFile=$2
url=$3
-if test "$#" -ne 1 && test "$#" -ne 3
+if test "$#" -ne 1 && test "$#" -ne 3 || test -z "$1"
then
echo "USAGE: $0 <BASE_COMMIT> [<OUTPUT_FILE> <URL>]"
exit 1
@@ -21,6 +21,12 @@ commitText=
commitTextmd=
goodParent=
+if ! git rev-parse --quiet --verify "${baseCommit}"
+then
+ echo "Invalid <BASE_COMMIT> '${baseCommit}'"
+ exit 1
+fi
+
while read dash sha etc
do
case "${dash}" in
@@ -67,7 +73,7 @@ then
goodParent=${baseCommit: 0:7}
fi
- echo "A whitespace issue was found in onen of more of the commits."
+ echo "A whitespace issue was found in one or more of the commits."
echo "Run the following command to resolve whitespace issues:"
echo "git rebase --whitespace=fix ${goodParent}"