Fix isExcluded gitignore handling using shared GitIgnore utility#1135
Merged
pdelagrave merged 6 commits intomainfrom Apr 1, 2026
Merged
Fix isExcluded gitignore handling using shared GitIgnore utility#1135pdelagrave merged 6 commits intomainfrom
pdelagrave merged 6 commits intomainfrom
Conversation
The isExcluded method had the same two bugs as the Gradle plugin: 1. Recursive call prepending '/' broke JGit path matching, making the gitignore check dead code 2. No DirCacheIterator check, so tracked files would have been incorrectly excluded if the path bug were fixed in isolation Replace the inline JGit implementation with the shared GitIgnore.isIgnoredAndUntracked() utility from rewrite-core.
timtebeek
reviewed
Mar 31, 2026
timtebeek
reviewed
Mar 31, 2026
…sh strip - Make isExcluded package-private and static with explicit Repository parameter, eliminating the sun.misc.Unsafe/reflection hack in tests - Remove redundant leading "/" strip since GitIgnore.isIgnoredAndUntracked already handles it
timtebeek
reviewed
Mar 31, 2026
timtebeek
approved these changes
Mar 31, 2026
mergify Bot
added a commit
to robfrank/linklift
that referenced
this pull request
May 3, 2026
… 6.34.0 to 6.38.0 [skip ci] Bumps [org.openrewrite.maven:rewrite-maven-plugin](https://github.com/openrewrite/rewrite-maven-plugin) from 6.34.0 to 6.38.0. Release notes *Sourced from [org.openrewrite.maven:rewrite-maven-plugin's releases](https://github.com/openrewrite/rewrite-maven-plugin/releases).* > 6.38.0 > ------ > > **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.37.0...v6.38.0> > > 6.37.0 > ------ > > What's Changed > -------------- > > * Fix GHSA-6fmv-xxpf-w3cw: pin plexus-utils 3.6.1 and suppress false positive by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1138](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1138) > * Validate DEVELOCITY\_ACCESS\_KEY format before build by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1141](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1141) > * Add Slack notification for scheduled CI failures by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1140](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1140) > * Resolve Maven user properties (-D) in YAML configuration by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1139](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1139) > * Skip parsing generated sources; use compiled classes instead by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1142](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1142) > * chore(ci): bump org.owasp:dependency-check-maven from 12.2.0 to 12.2.1 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1143](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1143) > * Fix plexus-utils CVE-2025-67030 suppression by [`@Jenson3210`](https://github.com/Jenson3210) in [openrewrite/rewrite-maven-plugin#1144](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1144) > * Move dependency-check-maven plugin from reporting to build by [`@Jenson3210`](https://github.com/Jenson3210) in [openrewrite/rewrite-maven-plugin#1145](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1145) > * chore(ci): bump actions/upload-pages-artifact from 4 to 5 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1146](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1146) > * chore(ci): bump io.micrometer:micrometer-core from 1.16.4 to 1.16.5 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1148](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1148) > * chore(ci): bump maven-dependencies.version from 3.9.14 to 3.9.15 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1147](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1147) > > **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.36.0...v6.37.0> > > 6.36.0 > ------ > > **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.35.1...v6.36.0> > > 6.35.1 > ------ > > What's Changed > -------------- > > * Fix datatable\_export test for updated CSV column headers by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1132](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1132) > * chore(ci): bump actions/configure-pages from 5 to 6 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1129](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1129) > * chore(ci): bump actions/deploy-pages from 4 to 5 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1130](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1130) > * Fix files falsely marked as changed by migration recipes by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1134](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1134) > * Pass null properties when resolvePropertiesInYaml=false by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1133](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1133) > * Fix isExcluded gitignore handling using shared GitIgnore utility by [`@pdelagrave`](https://github.com/pdelagrave) in [openrewrite/rewrite-maven-plugin#1135](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1135) > * bump vulnerabilities by [`@Jenson3210`](https://github.com/Jenson3210) in [openrewrite/rewrite-maven-plugin#1136](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1136) > > New Contributors > ---------------- > > * [`@pdelagrave`](https://github.com/pdelagrave) made their first contribution in [openrewrite/rewrite-maven-plugin#1135](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1135) > > **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.35.0...v6.35.1> > > 6.35.0 > ------ > > What's Changed > -------------- > > * Add optional version input to publish workflow by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1124](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1124) > * Use CsvDataTableStore for data table export by [`@jkschneider`](https://github.com/jkschneider) in [openrewrite/rewrite-maven-plugin#1125](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1125) > * chore(ci): bump com.fasterxml.jackson:jackson-bom from 2.17.3 to 2.21.2 by [`@dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1126](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1126) > * Load proxy settings from Maven settings.xml by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-maven-plugin#1127](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1127) > > **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.34.0...v6.35.0> Commits * [`4fe065c`](openrewrite/rewrite-maven-plugin@4fe065c) [maven-release-plugin] prepare release v6.38.0 * [`446bc8a`](openrewrite/rewrite-maven-plugin@446bc8a) Bump rewrite.version property * [`f3d983c`](openrewrite/rewrite-maven-plugin@f3d983c) Bump rewrite.version property * [`b5565ff`](openrewrite/rewrite-maven-plugin@b5565ff) Bump rewrite.version property * [`b7d7640`](openrewrite/rewrite-maven-plugin@b7d7640) [maven-release-plugin] prepare for next development iteration * [`caecb2f`](openrewrite/rewrite-maven-plugin@caecb2f) [maven-release-plugin] prepare release v6.37.0 * [`68bab02`](openrewrite/rewrite-maven-plugin@68bab02) Bump rewrite.version property * [`841ed61`](openrewrite/rewrite-maven-plugin@841ed61) chore(ci): bump maven-dependencies.version from 3.9.14 to 3.9.15 ([#1147](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1147)) * [`4b191ed`](openrewrite/rewrite-maven-plugin@4b191ed) chore(ci): bump io.micrometer:micrometer-core from 1.16.4 to 1.16.5 ([#1148](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1148)) * [`e8cb166`](openrewrite/rewrite-maven-plugin@e8cb166) chore(ci): bump actions/upload-pages-artifact from 4 to 5 ([#1146](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1146)) * Additional commits viewable in [compare view](openrewrite/rewrite-maven-plugin@v6.34.0...v6.38.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two bugs in
isExcluded(identical to those in the Gradle plugin):/for PathMatcher compatibility broke the JGit TreeWalk path comparison, making the gitignore check dead code.isEntryIgnored()was checked without consulting the git index, so tracked files would have been incorrectly excluded if the path bug were fixed.repoRelativePath.isEmpty() && "/".equals(repoRelativePath)was always false (&&should have been||).Replaces the inline JGit implementation with the shared
GitIgnore.isIgnoredAndUntracked()utility from rewrite-core (Add GitIgnore utility for gitignored-and-untracked checks rewrite#7215).Depends on Add GitIgnore utility for gitignored-and-untracked checks rewrite#7215.