mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Fixes #4 - Absolute paths fail on Windows due to backslash
This commit is contained in:
@@ -16,7 +16,10 @@ function gitCommand(cwd: string, ...args) {
|
|||||||
|
|
||||||
export default class Git {
|
export default class Git {
|
||||||
static normalizePath(fileName: string, repoPath: string) {
|
static normalizePath(fileName: string, repoPath: string) {
|
||||||
return (isAbsolute(fileName) ? relative(repoPath, fileName) : fileName).replace(/\\/g, '/');
|
if (isAbsolute(fileName) && fileName.startsWith(repoPath)) {
|
||||||
|
fileName = relative(repoPath, fileName);
|
||||||
|
}
|
||||||
|
return fileName.replace(/\\/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
static repoPath(cwd: string) {
|
static repoPath(cwd: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user