mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -55,6 +55,7 @@ die()
|
|||||||
echo '-----------------------' 1>&2
|
echo '-----------------------' 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
echo "$@" 1>&2
|
echo "$@" 1>&2
|
||||||
|
echo '' 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +86,12 @@ else
|
|||||||
fileList=$(git diff-index --cached --name-only $against --)
|
fileList=$(git diff-index --cached --name-only $against --)
|
||||||
fi
|
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
|
unset badFiles
|
||||||
# join list of files with this amount of space
|
# join list of files with this amount of space
|
||||||
|
|||||||
Reference in New Issue
Block a user