From 10a3b7e27961bbba72f39763af1c0e22b178a84b Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 1 May 2019 04:55:49 -0400 Subject: [PATCH] Fixes changes hover with renamed files --- src/annotations/annotations.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index eac62bf..6b96096 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -184,14 +184,15 @@ export class Annotations { const line = editorLine + 1; const commitLine = commit.lines.find(l => l.line === line) || commit.lines[0]; + let originalFileName = commit.originalFileName; + if (originalFileName === undefined) { + if (uri.fsPath !== commit.uri.fsPath) { + originalFileName = commit.fileName; + } + } + const commitEditorLine = commitLine.originalLine - 1; - const hunkLine = await Container.git.getDiffForLine( - uri, - commitEditorLine, - ref, - undefined, - commit.originalFileName - ); + const hunkLine = await Container.git.getDiffForLine(uri, commitEditorLine, ref, undefined, originalFileName); const message = this.getHoverDiffMessage(commit, uri, hunkLine, commitEditorLine); return {