-
Notifications
You must be signed in to change notification settings - Fork 337
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
Dont traverse gitignored dirs for gitignore files #797
Dont traverse gitignored dirs for gitignore files #797
Conversation
this seems to be an upstream issue in go-git, and i'll prepare a PR for them soon, but for now this copies in the affected method and fixes it by checking the accumulated patterns while walking the fs looking for gitignore files fixes: google#389
Using reflect to test for a non-included patterns
- Fatalf() -> Errorf(): show all failures not just first - adjust how the directory mid-tree dir is target in TestGitignoreFilesFromMidTree, I'm paranoid having fs point to root dir was giving false positives
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
- handle non git dirs - read parent dirs, up to repo root - regular reading of child dirs - recursive/non-recursive flag
@another-rex This is ready to look at now. I may add a few more tests to it, but it currently works, and has reasonable test coverage. I'm not sure how to add you as a reviewer so I'm just @-ing you here. |
Make sure we can handle the case where the files we're looking for don't exist
Co-authored-by: Rex P <106129829+another-rex@users.noreply.github.com>
@another-rex RE:
I've moved things round to make them easier to diff, but it shouldn't be massively different. You can see the difference with:
We are messing with a parsing algorithm, so that's risky a little, but also have fairly good tests for this generally. I'm expecting upstream to like the changes. My guess is they wont want |
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
+ Coverage 59.78% 59.86% +0.07%
==========================================
Files 136 138 +2
Lines 11268 11424 +156
==========================================
+ Hits 6737 6839 +102
- Misses 4102 4145 +43
- Partials 429 440 +11 ☔ View full report in Codecov by Sentry. |
We've already got this duplicated in two places, and I have need for it in an upcoming PR and @robramsaynz should be using it in #797 so let's move this into `testutility`
// TODO: convert `t.TempDir()` to `testutility.CreateTestDir(t)` once PR #832 lands | ||
dir := filepath.Join(t.TempDir(), "base_dir") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#832 has been merged so this can be actioned now, though I don't think it should block landing this
Updated version of #397.