Skip to content

Commit

Permalink
Fixes #1448 - decodes last #
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Apr 6, 2021
1 parent 0e2d4d0 commit 9708ae1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion src/git/remotes/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down

0 comments on commit 9708ae1

Please sign in to comment.