getRelativeFilePath fails on Windows due to case-sensitive string replacement
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript, vscode
- Domain
- devtools
Research direction
Start in src/utils.ts at getRelativeFilePath and compare the current path handling with the Windows example in the issue. Reproduce the case difference if possible, then verify that the generated blame URL contains the repository-relative path rather than the full local path.
Written by the indexing model from the issue text.
Description
On Windows, commands like "Githubinator: Blame" produce URLs containing the full local file path instead of the repo-relative path:
https://github.com/user/repo/blame/<sha>/E%3A%5Cgit%5Cruntime%5Csrc%5Clibraries%5C...
instead of:
https://github.com/user/repo/blame/<sha>/src/libraries/...
Root cause: In src/utils.ts, getRelativeFilePath uses String.replace():
const resolvedFileName = fs.realpathSync(fileName)
return resolvedFileName.replace(repositoryDir.fsPath, "")
fs.realpathSync() resolves to the true filesystem casing (e.g., E:\git\runtime\...), but repositoryDir.fsPath may have different casing (e.g., e:\git\runtime\...). Since String.replace() is case-sensitive, the replacement silently fails on Windows and the entire absolute path ends up in the URL.
Suggested fix: Use path.relative() instead, which handles case and separator differences correctly on all platforms:
const resolvedFileName = fs.realpathSync(fileName)
return path.relative(repositoryDir.fsPath, resolvedFileName)
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from chdsbd/vscode-githubinator
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
All issues in chdsbd/vscode-githubinator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·