Browse Source

Fixes #1669, #1695: avoid double encoding on space

main
Eric Amodio 3 years ago
parent
commit
5bac4b5d90
2 changed files with 7 additions and 1 deletions
  1. +2
    -0
      CHANGELOG.md
  2. +5
    -1
      src/git/remotes/provider.ts

+ 2
- 0
CHANGELOG.md View File

@ -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))

+ 5
- 1
src/git/remotes/provider.ts View File

@ -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');
}
}

Loading…
Cancel
Save