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) {