lint-staged: Error:Current directory is not a git directory!

Description

There is an error in v8.2.0,Current directory is not a git directory!

Steps to reproduce

I have this problem when I installed the new version of lint-staged. I think it may be because my .git is in the upper level of the installation directory. install path:/web-front/src-new/node_modules/lint-staged .git path: /web-front/.git

Debug Logs

popo_2019-06-11  11-41-39

Environment

  • OS: macOS High Sierra
  • Node.js: v10.14.1
  • lint-staged: v8.2.0

Ps

This should be because you changed the way get the .git directory in the new version. husky issue: https://github.com/typicode/husky/issues/500 your commit: https://github.com/okonet/lint-staged/commit/6ac666d

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 30 (16 by maintainers)

Commits related to this issue

Most upvoted comments

figured it out…

🎉 This issue has been resolved in version 8.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

I got the same problem with 8.2.0 on Linux Ubuntu 18.04, node 10.15.3.

After further investigations, I found out that only the following versions fail:

  • 10.0.1
  • 10.0.2
  • 10.0.3
  • 10.0.4

10.0.0 and 10.0.5 works fine

Running yarn upgrade lint-staged resolved the issue for me.

@carnun I commented directly on the PR #628; I’d prefer that to #629 if it works, but personally am fine with either.