From 6cdea9ec05b8cff60e2e4017066dc77aaaf4d86f Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:29:15 +0200 Subject: [PATCH] Git - fallback to `relative()` when computing relative paths (#247848) --- extensions/git/src/git.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 3433770b1f9..f6b487e8b93 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -3008,8 +3008,8 @@ export class Repository { return relativePath; } - // Fallback to the original path - filePath = sanitizeRelativePath(filePath); + // Fallback to relative() + filePath = sanitizeRelativePath(path.relative(this.repositoryRoot, filePath)); this.logger.trace(`[Git][sanitizeRelativePath] relativePath (fallback): ${filePath}`); return filePath; }