Преглед на файлове

Fixes #4 - Absolute paths fail on Windows due to backslash

main
Eric Amodio преди 8 години
родител
ревизия
d70a47201c
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. +4
    -1
      src/git.ts

+ 4
- 1
src/git.ts Целия файл

@ -16,7 +16,10 @@ function gitCommand(cwd: string, ...args) {
export default class Git {
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) {

Зареждане…
Отказ
Запис