-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make sure deleted files aren't restored due to git bugs #778
Conversation
Codecov Report
@@ Coverage Diff @@
## master #778 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 13 13
Lines 485 486 +1
Branches 106 107 +1
=====================================
+ Hits 485 486 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've given this a go, and it's working for all the tests I ran.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes and it’s good to go.
a6ece6f
to
892d706
Compare
The test coverage decrease is due to current git versions not hitting the special case. I'll have to extract it back into a separate function so that it can be tested via a mock. EDIT: Handled via a synthetic test to see that the method deletes untracked files when run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think await
would be more appropriate but I leave to you.
@tremby If you don't mind, could you test this again after the rebase? There were some other related changes put into master. |
What about this, @okonet? |
🎉 This PR is included in version 10.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Late response but I've tested again with the latest release. Looks good. Thanks. |
Fixes #561
Currently, version 10 only fixes some of the issues with deleted files getting restored when running lint-staged. This PR adds yet more checks to fix the remaining issues. The issue itself seems to be with the way git tracks files, and you can read more here in Stack Overflow.
I also updated some eslint rules to take into account the Node.js version bump, and after that refactored the file api to use
fs.promises
to simplify the code.