fix: case-insensitive path comparison in Worktree.Status() - #6
Open
RawNuke wants to merge 1 commit into
Open
Conversation
When core.ignorecase is true (macOS/Windows), use case-insensitive path matching via findInIndex() to compare filesystem entries against index entries. Files with casing-only differences (README.md vs Readme.md) are correctly matched as unmodified. Additions: - Worktree struct with Status() method that walks the filesystem - findInIndex() for case-aware index lookup - pathsMatch() preserved from prior fix, used in Status() - IsClean() on Status type - 7 passing tests covering case-insensitive and case-sensitive scenarios The fix respects core.ignorecase from repository config and does not introduce regressions on case-sensitive filesystems. Signed-off-by: RawNuke <67506722+RawNuke@users.noreply.github.com>
|
😅 Ups... the issue does not have any reward yet! |
Author
|
The work is complete. Thank you for the chance to help.
A donation is optional and always appreciated. |
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.
/claim #1
What
Fixes case-insensitive path comparison in Worktree.Status() on case-insensitive filesystems (macOS APFS, Windows NTFS).
Problem
When core.ignorecase is true (default on macOS/Windows), Worktree.Status() performed case-sensitive path comparison between index entries and filesystem paths. Files with casing-only changes (README.md vs Readme.md) were incorrectly reported as modified or untracked.
Solution
Extends the existing pathsMatch() and isIgnoreCase() helpers with:
The fix respects core.ignorecase from repository config. On case-sensitive filesystems, files differing only by case are treated as distinct entries.
Tests
All 7 tests pass: