From 87215850b70b4be0636901e68dd5d6d84bd65444 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 14 Sep 2016 00:55:48 -0400 Subject: [PATCH] Fixes #4 - Absolute paths fail on Windows due to backslash --- src/git.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/git.ts b/src/git.ts index 5660e94238e84..e0621311bb875 100644 --- a/src/git.ts +++ b/src/git.ts @@ -11,8 +11,7 @@ function gitCommand(cwd: string, ...args) { export default class Git { static normalizePath(fileName: string, repoPath: string) { - fileName = fileName.replace(/\\/g, '/'); - return isAbsolute(fileName) ? relative(repoPath, fileName) : fileName; + return (isAbsolute(fileName) ? relative(repoPath, fileName) : fileName).replace(/\\/g, '/'); } static repoPath(cwd: string) {