jish/pre-commit

pre-commit errors out on submodule add

Closed this issue · 1 comments

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'

this explains #147 - closing as duplicate