Skip to content

Commit a88374d

Browse files
committed
Updates stash drop title based on count
1 parent 4cf0012 commit a88374d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/commands/git/stash.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { formatPath } from '../../system/-webview/formatPath';
1919
import { getLoggableName, Logger } from '../../system/logger';
2020
import { startLogScope } from '../../system/logger.scope';
2121
import { defer } from '../../system/promise';
22-
import { pad } from '../../system/string';
22+
import { pad, pluralize } from '../../system/string';
2323
import type { ViewsWithRepositoryFolders } from '../../views/viewBase';
2424
import type {
2525
AsyncStepResultGenerator,
@@ -111,9 +111,6 @@ const subcommandToTitleMap = new Map<State['subcommand'], string>([
111111
['rename', 'Rename'],
112112
]);
113113
function getTitle(title: string, subcommand: State['subcommand'] | undefined) {
114-
if (subcommand === 'drop') {
115-
title = 'Stashes';
116-
}
117114
return subcommand == null ? title : `${subcommandToTitleMap.get(subcommand)} ${title}`;
118115
}
119116

@@ -442,6 +439,11 @@ export class StashGitCommand extends QuickCommand<State> {
442439
state.references = result;
443440
}
444441

442+
context.title = getTitle(
443+
pluralize('Stash', state.references.length, { only: true, plural: 'Stashes' }),
444+
state.subcommand,
445+
);
446+
445447
const result = yield* this.dropCommandConfirmStep(state, context);
446448
if (result === StepResultBreak) continue;
447449

0 commit comments

Comments
 (0)