mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-14 01:25:43 -05:00
Fixes #85 - Show File Commit Details doesn't work on last line if it is empty
This commit is contained in:
@@ -423,8 +423,11 @@ export class GitService extends Disposable {
|
||||
const blame = await this.getBlameForFile(uri);
|
||||
if (blame === undefined) return undefined;
|
||||
|
||||
const blameLine = blame.lines[line];
|
||||
if (blameLine === undefined) return undefined;
|
||||
let blameLine = blame.lines[line];
|
||||
if (blameLine === undefined) {
|
||||
if (blame.lines.length !== line) return undefined;
|
||||
blameLine = blame.lines[line - 1];
|
||||
}
|
||||
|
||||
const commit = blame.commits.get(blameLine.sha);
|
||||
if (commit === undefined) return undefined;
|
||||
|
||||
Reference in New Issue
Block a user