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

wildcard support for directories with preceding / #6

Merged
merged 2 commits into from Jan 16, 2016
Merged

wildcard support for directories with preceding / #6

merged 2 commits into from Jan 16, 2016

Conversation

faiq
Copy link
Contributor

@faiq faiq commented Jan 14, 2016

Right now this parse doesn't account for the * operator when there is a preceding / for a directory.

For example, if you have /foo/*.bar in your .gitignore file it should ignore both the /foo/yo.bar and foo/something.bar paths, but right now the parser only ignores /foo/yo.bar.

If there is not a preceding / for a directory, like in this example:
bar/*.txt

both bar/something.txt and /bar/somethingelse.txt are blocked

So this also makes the behavior a little more consistent

@faiq
Copy link
Contributor Author

faiq commented Jan 14, 2016

This pull request ended up being a lot larger than i originally intended. i'm going to add line comments on where i made changes to support this


// TODO: Handle [Rule 4] which negates the match for patterns leading with "!"
negatePattern := false
if line[0] == '!' {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaned this up, so you don't have to cast unnecessarily

sabhiram added a commit that referenced this pull request Jan 16, 2016
wildcard support for directories with preceding /
@sabhiram sabhiram merged commit 228fcfa into sabhiram:master Jan 16, 2016
@sabhiram
Copy link
Owner

You are awesome! Thank you for the tests!

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

Successfully merging this pull request may close these issues.

2 participants