Commit 1b2a16d9 authored by Brad King's avatar Brad King

pre-commit: Print instructions to chmod files

On Windows, "chmod" does not work, so print the instructions
to use "git update-index --chmod=" instead.
parent 6f2466c5
......@@ -129,10 +129,26 @@ mode_looks_exe() {
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."
echo "The file '$file' has looks executable but does not have an executable mode.
On UNIX, run:
$ chmod u+x '$file' && git add -u '$file'
On Windows, run:
$ git update-index --chmod=+x '$file'
"
}
mode_bad_exe () {
echo "The file '$file' has executable mode but does not look executable."
echo "The file '$file' has executable mode but does not look executable.
On UNIX, run:
$ chmod u-x '$file' && git add -u '$file'
On Windows, run:
$ git update-index --chmod=-x '$file'
"
}
mode_non_file () {
echo "The path '$file' has a non-file mode."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment