From d67f3d72b161f52f170ccd80b76906479ce0d330 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 1 Nov 2020 01:03:08 -0400 Subject: [PATCH] Handles empty commits better --- src/quickpicks/commitQuickPickItems.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/quickpicks/commitQuickPickItems.ts b/src/quickpicks/commitQuickPickItems.ts index 9b795eb..5756523 100644 --- a/src/quickpicks/commitQuickPickItems.ts +++ b/src/quickpicks/commitQuickPickItems.ts @@ -16,9 +16,11 @@ export class CommitFilesQuickPickItem extends CommandQuickPickItem { label: commit.getShortMessage(), // eslint-disable-next-line no-template-curly-in-string description: CommitFormatter.fromTemplate('${author}, ${ago} $(git-commit) ${id}', commit), - detail: `$(files) ${commit.getFormattedDiffStatus({ expand: true, separator: ', ' })}${ - fileName ? `${Strings.pad(GlyphChars.Dot, 2, 2)}${fileName}` : '' - }`, + detail: `$(files) ${commit.getFormattedDiffStatus({ + expand: true, + separator: ', ', + empty: 'No files changed', + })}${fileName ? `${Strings.pad(GlyphChars.Dot, 2, 2)}${fileName}` : ''}`, picked: picked, }, undefined,