diff options
author | Michael Smith <msmith@songbirdnest.com> | 2009-02-10 12:17:10 -0800 |
---|---|---|
committer | Michael Smith <msmith@songbirdnest.com> | 2009-02-10 12:17:10 -0800 |
commit | 87936c48afae911843b4a827869dbf2bd65ea6e9 (patch) | |
tree | 45aefb6c8fc15cd0dcb4fb930ea69ffd6fc7a12b /hooks | |
parent | 80c627dfabb45c3f40727dce755c81bed1e38e3d (diff) |
pre-commit script: only run on files that exist, not deleted files.
Add --diff-filter=ACMR to only get added, copied, modified, or renamed
files (importantly, not deleted files!) in the list of files we run the
indent script on.
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 a896fa4..e538fbd 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 --cached --name-only HEAD | grep "\.c$"` ; do +for file in `git-diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do # nf is the temporary checkout. This makes sure we check against the # revision in the index (and not the checked out version). nf=`git checkout-index --temp ${file} | cut -f 1` |