From 28034ced7a5c732030e87e42906f157cb6d390ab Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 10 Dec 2018 00:58:07 -0500 Subject: [PATCH] Fixes #552 - comparing across renames wouldn't always work --- CHANGELOG.md | 1 + src/commands/diffLineWithWorking.ts | 2 +- src/git/parsers/blameParser.ts | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52eb92..c6d7795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Fixes an issue where gravatar icons would sometimes not show up — thanks to [PR #579](https://github.com/eamodio/vscode-gitlens/pull/579) by sgtwilko ([@sgtwilko](https://github.com/sgtwilko)) - Fixes [#501](https://github.com/eamodio/vscode-gitlens/issues/501) — Azure DevOps ssh remotes aren't handled properly +- Fixes [#552](https://github.com/eamodio/vscode-gitlens/issues/552) — "Open Line Changes with..." doesn't work for renamed files - Fixes [#566](https://github.com/eamodio/vscode-gitlens/issues/566) — History error with UNC - Fixes [#572](https://github.com/eamodio/vscode-gitlens/issues/572) — Explorer cant expand some branch folders - Fixes an issue where comparing a file with its staged revision doesn't show any content diff --git a/src/commands/diffLineWithWorking.ts b/src/commands/diffLineWithWorking.ts index 731c21e..c5eacf3 100644 --- a/src/commands/diffLineWithWorking.ts +++ b/src/commands/diffLineWithWorking.ts @@ -76,7 +76,7 @@ export class DiffLineWithWorkingCommand extends ActiveEditorCommand { }, rhs: { sha: '', - uri: args.commit.uri + uri: args.commit.workingUri }, line: args.line, showOptions: args.showOptions diff --git a/src/git/parsers/blameParser.ts b/src/git/parsers/blameParser.ts index 1a5b7b6..f2ebd1c 100644 --- a/src/git/parsers/blameParser.ts +++ b/src/git/parsers/blameParser.ts @@ -125,6 +125,9 @@ export class GitBlameParser { ); relativeFileName = Strings.normalizePath(paths.relative(repoPath, fileName)); } + else { + relativeFileName = entry.fileName!; + } first = false; GitBlameParser.parseEntry(entry, repoPath, relativeFileName, commits, authors, lines, currentUser); @@ -159,7 +162,7 @@ export class GitBlameParser { private static parseEntry( entry: BlameEntry, repoPath: string | undefined, - fileName: string | undefined, + relativeFileName: string, commits: Map, authors: Map, lines: GitCommitLine[], @@ -197,8 +200,8 @@ export class GitBlameParser { entry.authorEmail, new Date((entry.authorDate as any) * 1000), entry.summary!, - fileName!, - fileName !== entry.fileName ? entry.fileName : undefined, + relativeFileName, + relativeFileName !== entry.fileName ? entry.fileName : undefined, entry.previousSha, entry.previousSha && entry.previousFileName, []