Fix File Not Found error when git pull [INS-1940]#9613
Conversation
✅ Circular References ReportGenerated at: 2026-02-09T03:48:12.243Z Summary
Click to view all circular references in PR (78)Click to view all circular references in base branch (78)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
There was a problem hiding this comment.
Pull request overview
Fixes a Windows-specific NotFoundError during pull/merge conflict handling by ensuring blob paths are constructed using POSIX separators, aligning with isomorphic-git’s expected filepath format.
Changes:
- Use
path.posix.joinwhen building tree-walk paths so map keys are POSIX-style blob paths. - Add additional console logging when
MergeConflictErroris detected during pull and manual merge fallback.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (const entry of entries) { | ||
| const filepath = path.join(prefix, entry.path); | ||
| const filepath = path.posix.join(prefix, entry.path); | ||
| if (entry.type === 'tree') { | ||
| const { tree: subtree } = await git.readTree({ ...baseOpts, oid: entry.oid }); |
There was a problem hiding this comment.
Consider adding a regression test for this Windows-specific path separator issue. The previous implementation used path.join, which yields \\ on Windows and can cause git.readBlob({ filepath }) to throw NotFoundError. Since CI may not run on Windows, a deterministic test could mock node:path so that join behaves like path.win32.join, then assert that getTreeMap() produces keys with forward slashes (or that downstream readBlob calls receive posix-style filepath).
The keys in the map constructed within findConflictLikeChanges represent blob paths. We should use forward slashes as separators; otherwise, git.readBlob will throw a NotFoundError later on.
