Check new files and files whose mode changes to verify that each file
mode matches the content of the file. The mode of a file must be
executable if and only if the file looks executable (name ends in a
Windows executable extension or content starts with a shebang line).
Stop processing the commit message text at a "diff --git" line. Such
lines occur when the user commits with the "-v" option. We should not
check the patch content; it will be stripped by Git anyway.
Commit "Reject leading TABs" added use of shell syntax of the form
$(case "..." in
a) ... ;;
esac)
Some shell implementations fail to recognize that the ')' in the case
label is not the end of the '$(' expression. Work around the problem
by moving the case block into a separate function outside the '$()'
expression.
Store a backup copy of the input message. Remove the backup only on
success. On failure, tell the user how to use and edit the message
without having to enter it from scratch.