diff --git a/oscar/git-pre-commit-hook b/oscar/git-pre-commit-hook index ae916bf..d52ec00 100755 --- a/oscar/git-pre-commit-hook +++ b/oscar/git-pre-commit-hook @@ -6,6 +6,14 @@ else against=$(git hash-object -t tree /dev/null) fi +# https://stackoverflow.com/a/7292992 +. git-sh-setup # for die +if git-diff-index -p -M --cached $against -- \ +| grep '^+' \ +| grep TODO; then + die Blocking commit because string TODO detected in patch +fi + # If you want to allow non-ASCII filenames set this variable to true. allownonascii=$(git config --type=bool hooks.allownonascii)