瀏覽代碼

Adds gravatar support to more commits

main
Eric Amodio 7 年之前
父節點
當前提交
6e701589a6
共有 2 個檔案被更改,包括 6 行新增6 行删除
  1. +4
    -4
      src/views/commitFileNode.ts
  2. +2
    -2
      src/views/statusFileCommitsNode.ts

+ 4
- 4
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));

+ 2
- 2
src/views/statusFileCommitsNode.ts 查看文件

@ -19,7 +19,7 @@ export class StatusFileCommitsNode extends ExplorerNode {
}
async getChildren(): Promise<ExplorerNode[]> {
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<TreeItem> {
@ -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();
}

Loading…
取消
儲存