From dd0762152f66704cc19b6b7158d907e68c24740d Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 22 Mar 2017 00:56:58 -0400 Subject: [PATCH] Adds file status roll up to changed files quick pick item --- src/quickPicks/commitDetails.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/quickPicks/commitDetails.ts b/src/quickPicks/commitDetails.ts index 97592c2..f3266af 100644 --- a/src/quickPicks/commitDetails.ts +++ b/src/quickPicks/commitDetails.ts @@ -61,9 +61,14 @@ export class CommitDetailsQuickPick { description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.shortSha} \u00a0 $(git-compare) \u00a0 $(file-directory) Working Tree` }, Commands.DiffDirectory, [uri, commit.sha])); + + const added = commit.fileStatuses.filter(_ => _.status === 'A' || _.status === '?').length; + const deleted = commit.fileStatuses.filter(_ => _.status === 'D').length; + const changed = commit.fileStatuses.filter(_ => _.status !== 'A' && _.status !== '?' && _.status !== 'D').length; + items.splice(index++, 0, new CommandQuickPickItem({ label: `Changed Files`, - description: null + description: `+${added} ~${changed} -${deleted}` }, Commands.ShowQuickCommitDetails, [uri, commit.sha, commit, goBackCommand, repoLog])); items.push(new OpenCommitFilesCommandQuickPickItem(commit));