jish / pre-commit

A slightly improved pre-commit hook for git
https://jish.github.io/pre-commit/
Other
796 stars 96 forks source link

Skip checking when staged files are empty #211

Closed TakiTake closed 9 years ago

TakiTake commented 9 years ago

I think it's better that skip checking when "staged_files" is empty array.

# If staged_files is empty, following git command execute
# So every staged files are checked even if they are written in .pre_commit.ignore
git diff-index --check --cached HEAD --  2>&1
mpapis commented 9 years ago

:+1: at least at first glance ;)

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.0%) to 98.65% when pulling ef96369f616c5ff8225b19c534f96afb0150a89a on TakiTake:skip_checking_when_staged_files_are_empty into 6840a5eed38f4b88d27b0b4c158dbaf522750899 on jish:master.

jish commented 9 years ago

Thanks for your contribution!

TakiTake commented 9 years ago

Thank you too! It's my favorite Gem :)