Skip to content

Fix editorconfig root detection in git worktrees#18953

Open
FelmonFekadu wants to merge 2 commits intoprettier:mainfrom
FelmonFekadu:fix-worktree-editorconfig-boundary
Open

Fix editorconfig root detection in git worktrees#18953
FelmonFekadu wants to merge 2 commits intoprettier:mainfrom
FelmonFekadu:fix-worktree-editorconfig-boundary

Conversation

@FelmonFekadu
Copy link

Summary

  • treat .git files as project root markers in addition to .git/.hg directories
  • prevent .editorconfig lookup from escaping a git worktree and inheriting unrelated parent config
  • add a regression test that creates a temporary worktree-style .git file under the existing editorconfig fixture tree

Testing

  • yarn test tests/integration/tests/config-resolution.js --runInBand

Fixes #18872

@netlify
Copy link

netlify bot commented Mar 21, 2026

Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 37c6715
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/69bde8848f584c00085cfb7b
😎 Deploy Preview https://deploy-preview-18953--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Editorconfig resolution ignores .git project boundary in git worktrees, picks up unrelated .editorconfig from parent directories

1 participant