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

Fixes ignore matching on directories #204

Merged
merged 4 commits into from
Sep 13, 2023
Merged

Fixes ignore matching on directories #204

merged 4 commits into from
Sep 13, 2023

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Sep 7, 2023

Intent

Fixes ignore matching on rules that end with a /, which signifies a directory.

Closes #103

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

Sends os.FileInfo to the GitIgnoreList#match method so that info.IsDir() returns true on L291. This adds the base+"/ variant to the ss array.

Automated Tests

Adds assertions for ignore rules ending in /.

Directions for Reviewers

Verify that ignore rules that end in / are respected.

Checklist

@tdstein tdstein self-assigned this Sep 7, 2023
@tdstein tdstein marked this pull request as ready for review September 7, 2023 16:20
@tdstein tdstein merged commit d1395ff into main Sep 13, 2023
13 checks passed
@tdstein tdstein deleted the tdstein/103 branch September 13, 2023 15:07
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.

gitignore matcher doesn't handle paths with trailing slash
2 participants