DirectoryCatalog should not do ToUpper if case sensitivity is enabled

Open
#111,181 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start with DirectoryCatalog.cs at the linked method around lines 727-737 and inspect the early-return check that calls ToUpperInvariant on Windows file paths. Use the reproduction linked from microsoft/typespec#5518 to verify behavior, then confirm that paths preserve case when directory case-sensitivity is enabled while existing insensitive behavior remains unchanged.

Written by the indexing model from the issue text.

Description

area-System.ComponentModel bug
Description

This method will call ToUpperInvariant on the file paths for Windows. This causes issues if case-sensitivity has been enabled for a directory. The check where we return early should likely be updated to account for whether the directory has case-sensitivity enabled.

Reproduction Steps

Repro steps can be found here https://github.com/microsoft/typespec/issues/5518

Expected behavior

The file paths should respect case-sensitivity if enabled.

Actual behavior

File paths do not respect case-sensitivity.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.