Avoiding directory execution on hook (#10954) (#10955)

* test -x is not enough https://stackoverflow.com/a/39489087
This commit is contained in:
Vasil Mikhalenya 2020-04-04 19:29:58 +03:00 committed by GitHub
parent 2a06d3a590
commit 240258a3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 9 deletions

View file

@ -5,7 +5,7 @@ hookname=$(basename $0)
GIT_DIR=${GIT_DIR:-$(dirname $0)}
for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do
test -x "${hook}" || continue
test -x "${hook}" && test -f "${hook}" || continue
echo "${data}" | "${hook}"
exitcodes="${exitcodes} $?"
done