-
-
Notifications
You must be signed in to change notification settings - Fork 422
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 gitDir Bug for git specific executables #162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
=======================================
Coverage 89.74% 89.74%
=======================================
Files 3 3
Lines 39 39
Branches 5 5
=======================================
Hits 35 35
Misses 4 4
Continue to review full report at Codecov.
|
Hey @DeFuex! Thanks for your contribution. Can you please add a description to your PR so we have a paper trail? Also, can you rebase your commit and include a reference to the corresponding GHI ( Also, can you add a code comment explaining why is this line ever needed? See #158 (comment) Thanks! |
One issue that I'm having is that |
Inverses logic of checking for "not equal to `npm`", instead check that binary to run is equal to `git` (and accounting for absolute paths). This means that commands besides `npm` will also run in CWD instead of `gitDir`. Closes lint-staged#158
Change git binary check to match end of string (for absolute paths)
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.
Does endsWith
work in node 4.x?
Can you please also add a test for this case? After that it's good to merge! Thanks again for taking your time on this one. |
There is a test already that is tests that git is called with the correct arguments. We'll need to update the test and check that other tasks aren't. |
@okonet Doesn't this https://github.com/okonet/lint-staged/blob/master/test/runScript.spec.js#L98 cover that test? Will add a test for |
Looks like you're right! I think then it can be merged. 👍 |
Added some tests
sry guys, was at an event today, everythings merged 😄 |
Any thought on when this change will be released? |
@tnguyen14 it's released @3.4.2 |
Changelog
res.bin !== 'npm'
tores.bin === 'git'
Why
It's not possible to get the getDir path for git specific executions, in underlying directory paths and doing a precommit for lint-staged. Using
'git'
options specifically declares to use options that include the getDir option for doing precommits.TODO
Notes
Error report
Closes #158