mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-17 09:45:36 -05:00
Adds go back support to stash apply, delete, & save
This commit is contained in:
@@ -80,12 +80,12 @@ export class CommitDetailsQuickPick {
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
label: `$(git-pull-request) Apply Stashed Changes`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
||||
}, Commands.StashApply, [commit as GitStashCommit, true, false]));
|
||||
}, Commands.StashApply, [commit as GitStashCommit, true, false, currentCommand]));
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
label: `$(x) Delete Stashed Changes`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.message}`
|
||||
}, Commands.StashDelete, [commit as GitStashCommit, true]));
|
||||
}, Commands.StashDelete, [commit as GitStashCommit, true, currentCommand]));
|
||||
}
|
||||
|
||||
if (!stash) {
|
||||
|
||||
@@ -7,19 +7,19 @@ import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut }
|
||||
|
||||
export class StashListQuickPick {
|
||||
|
||||
static async show(git: GitService, stash: IGitStash, mode: 'list' | 'apply', goBackCommand?: CommandQuickPickItem): Promise<CommitQuickPickItem | CommandQuickPickItem | undefined> {
|
||||
static async show(git: GitService, stash: IGitStash, mode: 'list' | 'apply', goBackCommand?: CommandQuickPickItem, currentCommand?: CommandQuickPickItem): Promise<CommitQuickPickItem | CommandQuickPickItem | undefined> {
|
||||
const items = ((stash && Array.from(Iterables.map(stash.commits.values(), c => new CommitQuickPickItem(c)))) || []) as (CommitQuickPickItem | CommandQuickPickItem)[];
|
||||
|
||||
if (mode === 'list' && git.config.insiders) {
|
||||
items.splice(0, 0, new CommandQuickPickItem({
|
||||
label: `$(repo-push) Stash Unstaged Changes`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 stashes only unstaged changes`
|
||||
}, Commands.StashSave, [undefined, true]));
|
||||
}, Commands.StashSave, [undefined, true, currentCommand]));
|
||||
|
||||
items.splice(0, 0, new CommandQuickPickItem({
|
||||
label: `$(repo-push) Stash Changes`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 stashes all changes`
|
||||
}, Commands.StashSave));
|
||||
}, Commands.StashSave, [undefined, undefined, currentCommand]));
|
||||
}
|
||||
|
||||
if (goBackCommand) {
|
||||
|
||||
Reference in New Issue
Block a user