Procházet zdrojové kódy

Fixes the path of git: uris -- won't load content otherwise

main
Eric Amodio před 6 roky
rodič
revize
c2483200c9
3 změnil soubory, kde provedl 13 přidání a 7 odebrání
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -7
      src/git/gitService.ts
  3. +11
    -0
      src/git/gitUri.ts

+ 1
- 0
CHANGELOG.md Zobrazit soubor

@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes an issue where gravatar icons would sometimes not show up — thanks to [PR #579](https://github.com/eamodio/vscode-gitlens/pull/579) by sgtwilko ([@sgtwilko](https://github.com/sgtwilko))
- Fixes [#501](https://github.com/eamodio/vscode-gitlens/issues/501) — Azure DevOps ssh remotes aren't handled properly
- Fixes [#572](https://github.com/eamodio/vscode-gitlens/issues/572) — Explorer cant expand some branch folders
- Fixes an issue where comparing a file with its staged revision doesn't show any content
## [9.0.3] - 2018-12-06

+ 1
- 7
src/git/gitService.ts Zobrazit soubor

@ -1906,13 +1906,7 @@ export class GitService implements Disposable {
}
if (Git.isStagedUncommitted(ref)) {
const path = GitUri.resolve(fileName, repoPath);
return Uri.parse(
`git:${path}?${JSON.stringify({
path: path,
ref: '~'
})}`
);
return GitUri.git(fileName, repoPath);
}
return GitUri.toRevisionUri(ref, fileName, repoPath!);

+ 11
- 0
src/git/gitUri.ts Zobrazit soubor

@ -323,6 +323,17 @@ export class GitUri extends ((Uri as any) as UriEx) {
return Strings.normalizePath(relativePath);
}
static git(fileName: string, repoPath?: string) {
const path = GitUri.resolve(fileName, repoPath);
return Uri.parse(
`git:${path}?${JSON.stringify({
// Ensure we use the fsPath here, otherwise the url won't open properly
path: Uri.file(path).fsPath,
ref: '~'
})}`
);
}
static resolve(fileName: string, repoPath?: string) {
const normalizedFileName = Strings.normalizePath(fileName);
if (repoPath === undefined) return normalizedFileName;

Načítá se…
Zrušit
Uložit