diff --git a/src/quickPicks/common.ts b/src/quickPicks/common.ts index 2e6d982..5fbde15 100644 --- a/src/quickPicks/common.ts +++ b/src/quickPicks/common.ts @@ -117,13 +117,19 @@ export class CommitQuickPickItem implements QuickPickItem { detail: string; constructor(public commit: GitCommit) { + let message = commit.message; + const index = message.indexOf('\n'); + if (index !== -1) { + message = `${message.substring(0, index)}\u00a0$(ellipsis)`; + } + if (commit instanceof GitStashCommit) { - this.label = `${commit.stashName}\u00a0\u2022\u00a0${commit.message}`; + this.label = `${commit.stashName}\u00a0\u2022\u00a0${message}`; this.description = null; this.detail = `\u00a0 ${moment(commit.date).fromNow()}\u00a0\u00a0\u2022\u00a0 ${commit.getDiffStatus()}`; } else { - this.label = commit.message; + this.label = message; this.description = `\u00a0$(git-commit)\u00a0 ${commit.shortSha}`; this.detail = `\u00a0 ${commit.author}, ${moment(commit.date).fromNow()}${(commit.type === 'branch') ? `\u00a0\u00a0\u2022\u00a0 ${(commit as GitLogCommit).getDiffStatus()}` : ''}`; }