From 9708ae1116ce27f57c9919f184484f57b0d8048b Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 6 Apr 2021 19:36:50 -0400 Subject: [PATCH] Fixes #1448 - decodes last # --- CHANGELOG.md | 1 + src/git/remotes/custom.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 447595d..2743c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed +- Fixes [1448](https://github.com/eamodio/vscode-gitlens/issues/1448) - Hashes (#) are percent encoded in custom remote urls - Fixes [1447](https://github.com/eamodio/vscode-gitlens/issues/1447) - _Open File on Remote From..._ is missing remote branches - Fixes [1442](https://github.com/eamodio/vscode-gitlens/issues/1442) - Interactive Rebase Editor not opened but plain text file when called from terminal - Fixes [1439](https://github.com/eamodio/vscode-gitlens/issues/1439) - Copying a remote file URL for a file on Azure DevOps does not work — thanks to [PR #1440](https://github.com/eamodio/vscode-gitlens/pull/1440) by Lee C. ([MeltingMosaic](https://github.com/MeltingMosaic)) diff --git a/src/git/remotes/custom.ts b/src/git/remotes/custom.ts index bf58dc3..c994379 100644 --- a/src/git/remotes/custom.ts +++ b/src/git/remotes/custom.ts @@ -79,8 +79,9 @@ export class CustomRemote extends RemoteProvider { url = Strings.interpolate(this.urls.file, this.getContext({ file: fileName, line: line })); } + const decodeHash = url.includes('#'); url = this.encodeUrl(url); - if (line.includes('#')) { + if (decodeHash) { const index = url.lastIndexOf('%23'); if (index !== -1) { url = `${url.substring(0, index)}#${url.substring(index + 3)}`;