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