Git - fallback to relative() when computing relative paths (#247848)

This commit is contained in:
Ladislau Szomoru
2025-04-30 15:29:15 +02:00
committed by GitHub
parent eae004b31f
commit 6cdea9ec05

View File

@@ -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;
}