Skip to content

Commit

Permalink
Exclude deleted files from commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
manugoyal committed May 21, 2017
1 parent 138fade commit 5efab3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# This script does not handle file names that contain spaces.

cfiles=$(git diff --name-only HEAD | grep '\.\(cc\|hh\|c\|h\)$')
cfiles=$(git diff --name-only HEAD --diff-filter=d | grep '\.\(cc\|hh\|c\|h\)$')
numerrors=0
for f in $cfiles; do
diffoutput=$(clang-format $f | diff $f -)
Expand Down

0 comments on commit 5efab3f

Please sign in to comment.