Browse Source

Handles empty commits better

main
Eric Amodio 4 years ago
parent
commit
d67f3d72b1
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/quickpicks/commitQuickPickItems.ts

+ 5
- 3
src/quickpicks/commitQuickPickItems.ts View File

@ -16,9 +16,11 @@ export class CommitFilesQuickPickItem extends CommandQuickPickItem {
label: commit.getShortMessage(), label: commit.getShortMessage(),
// eslint-disable-next-line no-template-curly-in-string // eslint-disable-next-line no-template-curly-in-string
description: CommitFormatter.fromTemplate('${author}, ${ago} $(git-commit) ${id}', commit), 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, picked: picked,
}, },
undefined, undefined,

Loading…
Cancel
Save