Ver código fonte

Changes GitUri to have the full path (like normal Uris)

main
Eric Amodio 7 anos atrás
pai
commit
89a2471736
2 arquivos alterados com 5 adições e 11 exclusões
  1. +3
    -3
      src/git/gitEnrichment.ts
  2. +2
    -8
      src/git/gitUri.ts

+ 3
- 3
src/git/gitEnrichment.ts Ver arquivo

@ -96,11 +96,11 @@ export class GitCommit implements IGitCommit {
}
get previousUri(): Uri {
return this.previousFileName ? Uri.file(path.join(this.repoPath, this.previousFileName)) : this.uri;
return this.previousFileName ? Uri.file(path.resolve(this.repoPath, this.previousFileName)) : this.uri;
}
get uri(): Uri {
return Uri.file(path.join(this.repoPath, this.originalFileName || this.fileName));
return Uri.file(path.resolve(this.repoPath, this.originalFileName || this.fileName));
}
getFormattedPath(separator: string = ' \u00a0\u2022\u00a0 '): string {
@ -155,7 +155,7 @@ export class GitLogCommit extends GitCommit {
}
get nextUri(): Uri {
return this.nextFileName ? Uri.file(path.join(this.repoPath, this.nextFileName)) : this.uri;
return this.nextFileName ? Uri.file(path.resolve(this.repoPath, this.nextFileName)) : this.uri;
}
}

+ 2
- 8
src/git/gitUri.ts Ver arquivo

@ -25,27 +25,21 @@ export class GitUri extends Uri {
this.offset = 0;
if (uri.scheme === DocumentSchemes.GitLensGit) {
const data = GitProvider.fromGitContentUri(uri);
base._fsPath = data.originalFileName || data.fileName;
base._fsPath = path.resolve(data.repoPath, data.originalFileName || data.fileName);
this.offset = (data.decoration && data.decoration.split('\n').length) || 0;
if (!Git.isUncommitted(data.sha)) {
this.sha = data.sha;
this.repoPath = data.repoPath;
}
else {
base._fsPath = path.join(data.repoPath, base._fsPath);
}
}
else if (commit) {
base._fsPath = commit.originalFileName || commit.fileName;
base._fsPath = path.resolve(commit.repoPath, commit.originalFileName || commit.fileName);
if (!Git.isUncommitted(commit.sha)) {
this.sha = commit.sha;
this.repoPath = commit.repoPath;
}
else {
base._fsPath = path.join(commit.repoPath, base._fsPath);
}
}
}

Carregando…
Cancelar
Salvar