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: disambiguate stash reference #906
Conversation
Sweet -- There are integration tests! |
@okonet -- Are you able to assist here? I've been unable to get a passing build on your CI even without any changes in my branch. Locally, things look good and it also appears to be passing on Appveyor. https://ci.appveyor.com/project/okonet/lint-staged/builds/34808885 |
It looks like the snapshot is failing and I'm wondering why: - Merge branch 'branch-b'
+ Merge branch 'branch-b' into master Looks like a different version of git maybe? |
That's probably it. Maybe the snapshot can be losened to assert it only contains the necessary bits. |
@philipbjorge @okonet I updated dependencies and fixed the offending snapshot in #901 |
Codecov Report
@@ Coverage Diff @@
## master #906 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 602 602
Branches 142 142
=========================================
Hits 602 602
Continue to review full report at Codecov.
|
Thanks a lot @philipbjorge! |
🎉 This PR is included in version 10.2.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@okonet seems |
Thank you! |
Problem
#905
When you have a branch named
stash
, you receive the following error fromlint-staged
.Options
Stashes are stored at
refs/stash
and we could update this line withrefs/
to disambiguatehttps://github.com/okonet/lint-staged/blob/b078324d5e911ec5e667736b2c552af32f475751/lib/gitWorkflow.js#L102
Convert the call from
git stash list
togit log -g --pretty="%gD %H %gs" refs/stash
which returns the disambiguated stash refs (We'd need to introduce additional error handling as this command fails when there is no stash)The Solution
I went with the simpler option of updating the string to
refs/stash
I've added an integration test to verify this behavior.