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:
parent
e564a9810f
commit
420ac3b5d0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user