aboutsummaryrefslogtreecommitdiff
path: root/contrib/commit-msg/spellcheck
diff options
context:
space:
mode:
authorBenjamin C Meyer <ben@meyerhome.net>2012-01-25 00:36:24 -0500
committerBenjamin C Meyer <ben@meyerhome.net>2012-01-25 00:39:12 -0500
commitc92277bf74855ebb79f8662aa8ce9a2a3383168b (patch)
treedcc404ec8964e6a4c59367cd20d4e003d7cd66f7 /contrib/commit-msg/spellcheck
parent8425d932263e9d2302bd63c08ec9d088f9e32157 (diff)
downloadgit-hooks-c92277bf74855ebb79f8662aa8ce9a2a3383168b.tar.gz
git-hooks-c92277bf74855ebb79f8662aa8ce9a2a3383168b.tar.bz2
Don't turn on set -e until after we test for the presence of aspell.
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
Diffstat (limited to 'contrib/commit-msg/spellcheck')
-rwxr-xr-xcontrib/commit-msg/spellcheck7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/commit-msg/spellcheck b/contrib/commit-msg/spellcheck
index de4147c..0b9938d 100755
--- a/contrib/commit-msg/spellcheck
+++ b/contrib/commit-msg/spellcheck
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2010, Benjamin C. Meyer <ben@meyerhome.net>
+# Copyright (c) 2010-2012, Benjamin C. Meyer <ben@meyerhome.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -26,14 +26,15 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-set -e
-
function run_test
{
which aspell > /dev/null
if [ ! $? -eq 0 ] ; then
exit 0
fi
+
+ set -e
+
warnings=`cat "${1}" | grep -v '^#.*' | aspell list`
if [ ! -z "${warnings}" ] ; then
echo >&2 "Possible spelling errors in the commit message:"