jish / pre-commit

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

pre-commit errors out on submodule add #149

Closed Holek closed 10 years ago

Holek commented 10 years ago

If you add a submodule to your git repostory, and try to commit, precommit fails with:

pre-commit-0.16.0/lib/pre-commit/utils/staged_files.rb:15:in `read': Is a directory - path/to/submodule (Errno::EISDIR)
  from pre-commit-0.16.0/lib/pre-commit/utils/staged_files.rb:15:in `binary?'
  from pre-commit-0.16.0/lib/pre-commit/utils/staged_files.rb:8:in `block in staged_files'
  from pre-commit-0.16.0/lib/pre-commit/utils/staged_files.rb:8:in `reject'
  from pre-commit-0.16.0/lib/pre-commit/utils/staged_files.rb:8:in `staged_files'
  from pre-commit-0.16.0/lib/pre-commit/runner.rb:38:in `block in execute'
  from pre-commit-0.16.0/lib/pre-commit/runner.rb:38:in `map'
  from pre-commit-0.16.0/lib/pre-commit/runner.rb:38:in `execute'
  from pre-commit-0.16.0/lib/pre-commit/runner.rb:26:in `run_single'
  from pre-commit-0.16.0/lib/pre-commit/runner.rb:21:in `run'
  from pre-commit-0.16.0/lib/pre-commit.rb:21:in `run'
mpapis commented 10 years ago

this explains #147 - closing as duplicate