Skip to content
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(is-ignored): allow paths ending with / #1453

Merged
merged 3 commits into from Jan 11, 2022

Conversation

SamVerschueren
Copy link
Contributor

When using the isIgnored API, I noticed that providing dir/ as filepath argument didn't work and throws an error path must not be empty. The reason is that the GitIgnoreManager iterates over the segments of the path, which in one case is an empty string.

Added a check for that and also added tests for this API. Apparently it wasn't tested yet.

I'm fixing a bug or typo

  • if this is your first time contributing, run npm run add-contributor and follow the prompts to add yourself to the README
  • squash merge the PR with commit message "fix: [Description of fix]"

@jcubic
Copy link
Contributor

jcubic commented Jan 10, 2022

Please fix lint errors, there is no reason to wrap the expression in extra parentheses. It's only needed if you call a method on return value but here you have

expect(await x).toBe()

and await is in double parentheses.

@SamVerschueren
Copy link
Contributor Author

Fixed the linting issues but the tests are still failing. Looking into it.

@jcubic
Copy link
Contributor

jcubic commented Jan 10, 2022

What about if you just add .filter(Boolean) to exclude empty string as part of the path?

@SamVerschueren
Copy link
Contributor Author

@jcubic Yes you are correct! That feels a bit cleaner :).

I also found a bug in the ignore package that isomorphic-git uses. You can read more about it here.

@jcubic jcubic merged commit 611b04b into isomorphic-git:main Jan 11, 2022
@isomorphic-git-bot
Copy link
Member

🎉 This PR is included in version 1.10.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@billiegoose
Copy link
Member

Oh that's a wonderful enhancement! Thank you ❤️

@billiegoose
Copy link
Member

It makes me so happy to see folk contributing and @isomorphic-git-bot taking care of publishing... there's still things I wish were easier (running the tests and build still requires node 10 🤪 which is awfully out-of-date... something something experimental ECMAScript Modules stuff changed) but I tried to automate as much as I could. I never quite figured out how to make the repo auto-governed by an decentralized leaderless collective...

@SamVerschueren
Copy link
Contributor Author

Love the work you put in this project @wmhilton (and the rest of the folks hanging around here @jcubic). It's really cool to see a PR merged and be able to instantly use it! 💪

@mojavelinux
Copy link
Contributor

I second the sentiment shared by @SamVerschueren!

@jcubic
Copy link
Contributor

jcubic commented Jan 14, 2022

Yes, the CI/CD is great in this repo thanks to @wmhilton that build the thing, even if some parts of it are out of date.

modesty pushed a commit to modesty/isomorphic-git that referenced this pull request Apr 9, 2024
* fix(is-ignored): allow paths ending with /

* fix: linting errors

* fix: fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants