Permalink
Browse files

refs #4472. Corrected problem with detecting executable file.

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...
1 parent 6513a2c commit 33a8e0c97240785c163bb2139e35611410eb1aa3 @stuartcampbell stuartcampbell committed Feb 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 .githooks/pre-commit
View
@@ -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."

0 comments on commit 33a8e0c

Please sign in to comment.