summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2009-01-22 10:46:35 +0100
committerSebastian Dröge <slomo@circular-chaos.org>2009-01-22 10:46:35 +0100
commit42581d4ebf41013f91b57a30d8f3cbf7e56e478c (patch)
tree3265dbb1ebfa1584dffafb2503e731935435bae5 /hooks
parent137543b7e782c811bc88bf9210323e7e75835d18 (diff)
Fix pre-commit hook for moved/deleted files
Diffstat (limited to 'hooks')
-rw-r--r--hooks/pre-commit.hook3
1 files changed, 2 insertions, 1 deletions
diff --git a/hooks/pre-commit.hook b/hooks/pre-commit.hook
index 34dd510..0024483 100644
--- a/hooks/pre-commit.hook
+++ b/hooks/pre-commit.hook
@@ -7,7 +7,8 @@
echo "--Checking style--"
for file in `git-diff-index --name-only HEAD | grep "\.c$"` ; do
-tempfoo=`basename $0`
+ test -f ${file} || continue
+ tempfoo=`basename $0`
newfile=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1
indent \
--braces-on-if-line \