浏览代码

Fixes #591 & #633 - encodes uris properly now

main
Eric Amodio 5 年前
父节点
当前提交
b08e46fd6f
共有 2 个文件被更改,包括 12 次插入8 次删除
  1. +2
    -0
      CHANGELOG.md
  2. +10
    -8
      src/git/gitUri.ts

+ 2
- 0
CHANGELOG.md 查看文件

@ -8,9 +8,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#591](https://github.com/eamodio/vscode-gitlens/issues/591) - GitLens Error: Unable to open
- Fixes [#620](https://github.com/eamodio/vscode-gitlens/issues/620) - Branch names with only digits always appear first — thanks to [PR #621](https://github.com/eamodio/vscode-gitlens/pull/621) by Yan Zhang ([@Eskibear](https://github.com/Eskibear))
- Fixes [#626](https://github.com/eamodio/vscode-gitlens/issues/626) - Branch names with only digits always appear first — thanks to [PR #627](https://github.com/eamodio/vscode-gitlens/pull/627) by Marc Lasson ([@mlasson](https://github.com/mlasson))
- Fixes [#631](https://github.com/eamodio/vscode-gitlens/issues/631) - Remotes fail to show in gui
- Fixes [#633](https://github.com/eamodio/vscode-gitlens/issues/633) - Compare File with Previous Revision doesn't work if path contains '#'
## [9.4.1] - 2019-01-08

+ 10
- 8
src/git/gitUri.ts 查看文件

@ -326,11 +326,13 @@ export class GitUri extends ((Uri as any) as UriEx) {
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: '~'
})}`
`git:${encodeURIComponent(path)}?${encodeURIComponent(
JSON.stringify({
// Ensure we use the fsPath here, otherwise the url won't open properly
path: Uri.file(path).fsPath,
ref: '~'
})
)}`
);
}
@ -398,9 +400,9 @@ export class GitUri extends ((Uri as any) as UriEx) {
};
const uri = Uri.parse(
`${DocumentSchemes.GitLens}:///${repoName}@${shortSha}${
filePath === slash ? empty : filePath
}?${JSON.stringify(data)}`
`${DocumentSchemes.GitLens}:///${encodeURIComponent(repoName)}@${shortSha}${
filePath === slash ? empty : encodeURIComponent(filePath)
}?${encodeURIComponent(JSON.stringify(data))}`
);
return uri;
}

正在加载...
取消
保存