From 97e83ff431607702ee2fb73750f6d0bba95c7d56 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 30 Apr 2018 00:00:00 -0400 Subject: [PATCH] Fixes #359 - Show changes of an added file in the first commit --- CHANGELOG.md | 1 + src/gitService.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 639b4d2..46e67b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Adds a tree layout option to tags in the *GitLens* explorer — closes [#358](https://github.com/eamodio/vscode-gitlens/issues/358) ### Fixed +- Fixes [#359](https://github.com/eamodio/vscode-gitlens/issues/359) - Show changes of an added file in the first commit - Fixes issue where comparing previous revision during a merge/rebase conflict failed to show the correct contents - Fixes various issues when not on a branch diff --git a/src/gitService.ts b/src/gitService.ts index 58f213d..41dec32 100644 --- a/src/gitService.ts +++ b/src/gitService.ts @@ -1337,6 +1337,8 @@ export class GitService extends Disposable { async getVersionedFile(repoPath: string | undefined, fileName: string, sha: string | undefined) { Logger.log(`getVersionedFile('${repoPath}', '${fileName}', '${sha}')`); + if (sha === GitService.deletedSha) return undefined; + if (!sha || (Git.isUncommitted(sha) && !Git.isStagedUncommitted(sha))) { if (await this.fileExists(repoPath!, fileName)) return fileName;