ENH: skip checks in pre-commit hook when no files have changed

- this usage can correspond to a 'git commit --amend'
This commit is contained in:
Mark Olesen 2010-08-10 08:39:13 +02:00
parent e564a9810f
commit 420ac3b5d0

View File

@ -55,6 +55,7 @@ die()
echo '-----------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
echo '' 1>&2
exit 1
}
@ -85,7 +86,12 @@ else
fileList=$(git diff-index --cached --name-only $against --)
fi
# echo "files: $fileList" 1>&2
#
# no files changed: can skip all the checks
# this usage can correspond to a 'git commit --amend'
#
[ -n "$fileList" ] || exit 0
unset badFiles
# join list of files with this amount of space