Skip to content

Commit

Permalink
Fixes #591 & #633 - encodes uris properly now
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Jan 23, 2019
1 parent 461d552 commit b08e46f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 10 additions & 8 deletions src/git/gitUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '~'
})
)}`
);
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b08e46f

Please sign in to comment.