Skip to content

Conversation

@mashraf-222
Copy link
Contributor

Fix Windows path case sensitivity in "Optimize Changed Code" feature

Problem

On Windows, the "Optimize Changed Code" feature didn't detect functions in git diffs when the drive letter case differed (e.g., d:\code\... vs D:\code\...). Functions were filtered out as "outside module root" due to case-sensitive path comparisons.

Solution

  • Fixed git diff command: changed from git.diff(None, "HEAD") to git.diff("HEAD") for uncommitted changes
  • Normalized paths using os.path.normcase() for case-insensitive comparisons on Windows
  • Applied normalization to all path checks (tests_root, module_root, ignore_paths, submodule_paths)

Impact

  • Functions in git diffs are now correctly detected on Windows
  • No impact on Linux/macOS (normcase is a no-op on case-sensitive filesystems)
  • Fixes the issue where modified functions weren't added to the optimization queue

- Fix git diff command for uncommitted changes (use "HEAD" instead of None, "HEAD")
- Normalize paths using os.path.normcase() for case-insensitive comparison on Windows
- Fixes issue where functions in git diff were not detected on Windows due to drive letter case mismatch
KRRT7
KRRT7 previously approved these changes Jan 8, 2026
@aseembits93 aseembits93 enabled auto-merge January 8, 2026 21:20
@aseembits93 aseembits93 merged commit 4157d47 into main Jan 8, 2026
22 of 24 checks passed
@aseembits93 aseembits93 deleted the fix/git-diff-windows-path-case branch January 8, 2026 21:24
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.

5 participants