2005-08-19 00:20:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# An example hook script to verify what is about to be committed.
|
2005-09-08 00:26:23 +00:00
|
|
|
# Called by git-commit with no arguments. The hook should
|
2005-08-19 00:20:08 +00:00
|
|
|
# exit with non-zero status after issuing an appropriate message if
|
|
|
|
# it wants to stop the commit.
|
|
|
|
#
|
2008-06-25 01:45:21 +00:00
|
|
|
# To enable this hook, rename this file to "pre-commit".
|
2005-08-19 00:20:08 +00:00
|
|
|
|
2006-01-29 22:52:16 +00:00
|
|
|
if git-rev-parse --verify HEAD 2>/dev/null
|
|
|
|
then
|
2008-06-26 23:08:05 +00:00
|
|
|
against=HEAD
|
2006-01-29 22:52:16 +00:00
|
|
|
else
|
2008-06-26 23:08:05 +00:00
|
|
|
# Initial commit: diff against an empty tree object
|
|
|
|
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec git diff-index --check --cached $against --
|