From 23b2c679a9d9c72c8ee721f4178c184850d51957 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 22 Sep 2016 23:00:09 -0600 Subject: [PATCH] Fixes off-by-one issues with blame annotations without caching and when diffing with a previous version --- README.md | 4 ++++ package.json | 2 +- src/gitProvider.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f24c6b..9b707e8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ Must be using Git and it must be in your path. --- ## Release Notes +### 0.5.4 + + - Fixes off-by-one issues with blame annotations without caching and when diffing with a previous version + ### 0.5.3 - Adds better uncommitted hover message in blame annotations diff --git a/package.json b/package.json index 6f479ab..9d84b42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitlens", - "version": "0.5.3", + "version": "0.5.4", "author": { "name": "Eric Amodio", "email": "eamodio@gmail.com" diff --git a/src/gitProvider.ts b/src/gitProvider.ts index 2d5b97b..9d533d2 100644 --- a/src/gitProvider.ts +++ b/src/gitProvider.ts @@ -214,7 +214,7 @@ export default class GitProvider extends Disposable { fileName = Git.normalizePath(fileName); - return Git.blameLines(GitProvider.BlameFormat, fileName, line, line, sha, repoPath) + return Git.blameLines(GitProvider.BlameFormat, fileName, line + 1, line + 1, sha, repoPath) .then(data => new GitBlameParserEnricher(GitProvider.BlameFormat).enrich(data, fileName)) .then(blame => { if (!blame) return null; @@ -226,7 +226,7 @@ export default class GitProvider extends Disposable { return { author: blame.authors.values().next().value, commit: commit, - line: blame.lines[line - 1] + line: blame.lines[line] }; }) .catch(ex => null);