Created
April 13, 2016 11:36
-
-
Save gtklocker/a81d8bc62ac727272fe7cefc3e501405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| execgit() { | |
| exec git "$@" | |
| } | |
| if [ "`git rev-parse --is-inside-work-tree`" != "true" ]; then | |
| execgit | |
| fi | |
| dotGitDirectory="`git rev-parse --git-dir`" | |
| if [ "`find -L "$dotGitDirectory" -type f -perm +u+x,g+x,o+x ! -regex '.*\.sample$'|wc -l`" -gt "0" ]; then | |
| echo "INSECURE: Check your git hooks, someone may be attacking you." | |
| echo "Exiting." | |
| exit 1 | |
| else | |
| execgit | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment