9 if [ -z "$GIT_DIR" ]; then
10 echo "Don't run this script from the command line." >&2
11 echo " (if you want, you could supply GIT_DIR then run" >&2
12 echo " $0 <ref> <oldrev> <newrev>)" >&2
16 if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
17 echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
21 # Don't allow merge commits on master
22 if [ "$refname" = "refs/heads/master" ]
24 for rev in $
(git rev-list
$newrev --not $oldrev)
26 echo -n "Checking: $rev"
27 if git rev-parse
--verify --quiet $rev^
2 > /dev
/null
31 echo "Merges not allowed on master. Rebase your changes instead."