diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-02-05 14:41:21 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-02-05 14:41:21 +0000 |
commit | aaeae58df4e238dfc7f3903aa8aaf062190ed5cf (patch) | |
tree | 4c5b9de1fd4279b4bafc33aab9c760982c11406a /hooks | |
parent | 01ef680746388912c1d9499b42e598e63a1a574b (diff) |
pre-commit hook: only check indentation of those files we're trying to commit and not all locally modified files
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/pre-commit.hook | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hooks/pre-commit.hook b/hooks/pre-commit.hook index 1bcb90c..a1d7502 100755 --- a/hooks/pre-commit.hook +++ b/hooks/pre-commit.hook @@ -19,7 +19,7 @@ INDENT_PARAMETERS="--braces-on-if-line \ --indent-level2" echo "--Checking style--" -for file in `git-diff-index --name-only HEAD | grep "\.c$"` ; do +for file in `git-diff-index --cached --name-only HEAD | grep "\.c$"` ; do test -f ${file} || continue tempfoo=`basename $0` newfile=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 |