From 8b472fd74dbfd61d21440689664d2a85d543ff47 Mon Sep 17 00:00:00 2001 From: Philip Whineray Date: Sun, 10 Jan 2016 16:47:46 +0000 Subject: [PATCH] Fix hooks to work with older branches --- hooks/post-commit | 2 ++ hooks/pre-commit | 2 ++ hooks/prepare-commit-msg | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hooks/post-commit b/hooks/post-commit index a1d41c71..48293557 100755 --- a/hooks/post-commit +++ b/hooks/post-commit @@ -2,4 +2,6 @@ if [ -x ./packaging/update-tags ] then exec git diff HEAD^ | ./packaging/update-tags - +else + exit 0 fi diff --git a/hooks/pre-commit b/hooks/pre-commit index fb2209f0..7a9a2138 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -2,4 +2,6 @@ if [ -x ./packaging/check-files ] then exec git diff --cached | ./packaging/check-files - +else + exit 0 fi diff --git a/hooks/prepare-commit-msg b/hooks/prepare-commit-msg index 530f9576..9f180724 100755 --- a/hooks/prepare-commit-msg +++ b/hooks/prepare-commit-msg @@ -1,2 +1,7 @@ #!/bin/sh -test -x ./packaging/release-msg && exec ./packaging/release-msg "$@" +if [ -x ./packaging/release-msg ] +then + exec ./packaging/release-msg "$@" +else + exit 0 +fi