Skip to content

Commit

Permalink
Fixes #1669, #1695: avoid double encoding on space
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Nov 16, 2021
1 parent 4b37fab commit 5bac4b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fixes [#1669](https://github.com/Axosoft/vscode-gitlens/issues/1669) - Workitem Link (Hover ) for Repository (DevOps) with Blank is broken
- Fixes [#1695](https://github.com/Axosoft/vscode-gitlens/issues/1695) - gitlens.remotes: ${repo} has '%2520' instead of '%20' for a space
- Fixes [#1531](https://github.com/eamodio/vscode-gitlens/issues/1531) - Typo in `gitlens.defaultGravatarsStyle` options — thanks to [PR #1532](https://github.com/eamodio/vscode-gitlens/pull/1532) by Alwin Wang ([@alwinw](https://github.com/alwinw))
- Fixes [#1511](https://github.com/eamodio/vscode-gitlens/issues/1511) - Avatars are blurry on retina displays — thanks to [PR #1595](https://github.com/eamodio/vscode-gitlens/pull/1595) by Adaex Yang ([@adaex](https://github.com/adaex))
- Fixes [#1609](https://github.com/eamodio/vscode-gitlens/issues/1609) - X.globalState.setKeysForSync is not a function — thanks to [PR #1610](https://github.com/eamodio/vscode-gitlens/pull/1610) by Stanislav Lvovsky ([@slavik-lvovsky](https://github.com/slavik-lvovsky))
Expand Down
6 changes: 5 additions & 1 deletion src/git/remotes/provider.ts
Expand Up @@ -234,7 +234,11 @@ export abstract class RemoteProvider implements RemoteProviderReference {
protected encodeUrl(url: string): string;
protected encodeUrl(url: string | undefined): string | undefined;
protected encodeUrl(url: string | undefined): string | undefined {
return url != null ? encodeURI(url).replace(/#/g, '%23') : undefined;
if (url == null) return undefined;

// Not a fan of this, but it's hard to gauge previous encoding and this is the most common case
url = url.replace(/%20/g, ' ');
return encodeURI(url).replace(/#/g, '%23');
}
}

Expand Down

0 comments on commit 5bac4b5

Please sign in to comment.