-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Globstar doesn't match zero directories #88
Labels
Comments
mmxmb
changed the title
Globstar doesn't match the directory at 0th depth
Globstar doesn't match zero directories
Oct 16, 2023
I was able to fix this behavior by changing one line in
All existing test cases still pass and here's a new test case that passes after this change is made:
Are there any concerns about opening a PR with this change? |
Hey @mmxmb - ya, go ahead and open a PR =) That sounds right to me, but I'll take a closer look over the weekend. |
Thanks! Opened a PR: #89 |
Merged! Thanks =) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
I expect
a/**/
to match a directorya
butdoublestar.Match
returnsfalse
:Running this returns:
I understand that it's ambiguous whether
a
by itself is a regular file or a directory, therefore I am also trying to matcha/
.I assume that this project is attempting to replicate Bash globstar functionality, so here's my attempt at doing the same in Bash 5.2:
Bash shopt docs confirm that this is the intended behavior:
In this example, I am trying to match zero directories, or subdirectories.
Question
Can you please confirm whether this is an oversight in
doublestar.Match
implementation and check whether it's possible to correct this behavior?Versions
I am using
go1.21.3
andbmatcuk/doublestar/v4 v4.6.0
.The text was updated successfully, but these errors were encountered: