Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Prevent commit if diff contains "NOCHECKIN"
- if git rev-parse --verify HEAD >/dev/null 2>&1
- then
- against=HEAD
- else
- # Initial commit: diff against an empty tree object
- against=$(git hash-object -t tree /dev/null)
- fi
- # Redirect output to stderr.
- exec 1>&2
- git diff --name-only $against | xargs grep -iH nocheckin
- if [[ $? ]]; then
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement