From 3435ada18892f3dd999d734fc71c1352b40279bc Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 11 Mar 2017 00:42:18 -0500 Subject: [PATCH] Adds fileNames property Changes fileName to be the first file if multiples --- src/git/gitEnrichment.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/git/gitEnrichment.ts b/src/git/gitEnrichment.ts index d4f0e16..7b34380 100644 --- a/src/git/gitEnrichment.ts +++ b/src/git/gitEnrichment.ts @@ -115,6 +115,7 @@ export type GitLogType = 'file' | 'repo'; export class GitLogCommit extends GitCommit { + fileNames: string; fileStatuses: { status: GitFileStatus, fileName: string }[]; nextSha?: string; nextFileName?: string; @@ -138,8 +139,11 @@ export class GitLogCommit extends GitCommit { super(repoPath, sha, fileName, author, date, message, lines, originalFileName, previousSha, previousFileName); this.status = status; + this.fileNames = this.fileName; + if (fileStatuses) { this.fileStatuses = fileStatuses.filter(_ => !!_.fileName); + this.fileName = this.fileStatuses[0].fileName; } else { this.fileStatuses = [{ status: status, fileName: fileName }];