From 6e701589a64350534a860070c7764ea1be6f7755 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 16 Dec 2017 15:57:02 -0500 Subject: [PATCH] Adds gravatar support to more commits --- src/views/commitFileNode.ts | 8 ++++---- src/views/statusFileCommitsNode.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/commitFileNode.ts b/src/views/commitFileNode.ts index b427e15..f806ddb 100644 --- a/src/views/commitFileNode.ts +++ b/src/views/commitFileNode.ts @@ -7,12 +7,12 @@ import * as path from 'path'; export enum CommitFileNodeDisplayAs { CommitLabel = 1 << 0, - CommitIcon = 1 << 1, - FileLabel = 1 << 2, + FileLabel = 1 << 1, + + CommitIcon = 1 << 2, StatusIcon = 1 << 3, Gravatar = 1 << 4, - Commit = CommitLabel | CommitIcon, File = FileLabel | StatusIcon } @@ -25,7 +25,7 @@ export class CommitFileNode extends ExplorerNode { public readonly status: IGitStatusFile, public commit: GitLogCommit, protected readonly explorer: Explorer, - private displayAs: CommitFileNodeDisplayAs = CommitFileNodeDisplayAs.Commit, + private displayAs: CommitFileNodeDisplayAs, public readonly branch?: GitBranch ) { super(GitUri.fromFileStatus(status, commit.repoPath, commit.sha)); diff --git a/src/views/statusFileCommitsNode.ts b/src/views/statusFileCommitsNode.ts index 5ff880e..4742ffc 100644 --- a/src/views/statusFileCommitsNode.ts +++ b/src/views/statusFileCommitsNode.ts @@ -19,7 +19,7 @@ export class StatusFileCommitsNode extends ExplorerNode { } async getChildren(): Promise { - return this.commits.map(c => new CommitFileNode(this.status, c, this.explorer, CommitFileNodeDisplayAs.Commit, this.branch)); + return this.commits.map(c => new CommitFileNode(this.status, c, this.explorer, CommitFileNodeDisplayAs.CommitLabel | (this.explorer.config.gravatars ? CommitFileNodeDisplayAs.Gravatar : CommitFileNodeDisplayAs.CommitIcon), this.branch)); } async getTreeItem(): Promise { @@ -34,7 +34,7 @@ export class StatusFileCommitsNode extends ExplorerNode { if (this.commits.length === 1 && this.commits[0].isUncommitted) { item.collapsibleState = TreeItemCollapsibleState.None; - item.contextValue = 'gitlens:status-file' as ResourceType; + item.contextValue = ResourceType.StatusFile; item.command = this.getCommand(); }