Fix case insensitivity for the managed engine on git worktrees, and implement for libgit2 by AArnott · Pull Request #1334 · dotnet/Nerdbank.GitVersioning (original) (raw)
Pull request overview
This PR fixes case-insensitive version file lookup when a repo-relative path’s casing doesn’t match what Git recorded, with special attention to git worktrees and bringing LibGit2 behavior in line with the managed engine.
Changes:
- Updated the case-insensitive path matching test to require the behavior for both Managed and LibGit2 engines.
- Managed engine:
core.ignorecasedetection now checks bothCommonDirectory/configandGitDirectory/configto better support worktrees. - LibGit2 engine: normalizes the repo-relative project directory path to the commit tree’s actual casing when
core.ignorecaseis enabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Nerdbank.GitVersioning.Tests/VersionFileTests.cs | Strengthens the case-insensitive path test to apply to both engines. |
| src/NerdBank.GitVersioning/ManagedGit/GitRepository.cs | Improves core.ignorecase config discovery for worktree scenarios by checking common + worktree git dirs. |
| src/NerdBank.GitVersioning/LibGit2/LibGit2VersionFile.cs | Adds tree-based case-insensitive path normalization when core.ignorecase is true. |