Skip to content

Commit

Permalink
refs #4472. Corrected problem with detecting executable file.
Browse files Browse the repository at this point in the history
If you tried to commit a file with the executable flag set that
wasn't one of the normal extensions it would look at the first
line to see if it could see the normal unix #!/blah.

But the "!" in the grep wasn't escaped - so it is now!
  • Loading branch information
stuartcampbell committed Feb 24, 2012
1 parent 6513a2c commit 33a8e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Expand Up @@ -121,7 +121,7 @@ mode_looks_exe() {
*.exe) return 0 ;;
*.com) return 0 ;;
esac
git cat-file blob "$2" | head -1 | grep "^#!/" > /dev/null
git cat-file blob "$2" | head -1 | grep "^#\!/" > /dev/null
}
mode_not_exe () {
echo "The file '$file' has looks executable but does not have an executable mode."
Expand Down

0 comments on commit 33a8e0c

Please sign in to comment.