mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-12 19:18:32 -05:00
Adds go back support to stash apply, delete, & save
This commit is contained in:
@@ -3,6 +3,7 @@ import { InputBoxOptions, window } from 'vscode';
|
||||
import { GitService } from '../gitService';
|
||||
import { Command, Commands } from './common';
|
||||
import { Logger } from '../logger';
|
||||
import { CommandQuickPickItem } from '../quickPicks';
|
||||
|
||||
export class StashSaveCommand extends Command {
|
||||
|
||||
@@ -10,7 +11,7 @@ export class StashSaveCommand extends Command {
|
||||
super(Commands.StashSave);
|
||||
}
|
||||
|
||||
async execute(message?: string, unstagedOnly: boolean = false) {
|
||||
async execute(message?: string, unstagedOnly: boolean = false, goBackCommand?: CommandQuickPickItem) {
|
||||
if (!this.git.config.insiders) return undefined;
|
||||
if (!this.git.repoPath) return undefined;
|
||||
|
||||
@@ -20,7 +21,7 @@ export class StashSaveCommand extends Command {
|
||||
prompt: `Please provide a stash message`,
|
||||
placeHolder: `Stash message`
|
||||
} as InputBoxOptions);
|
||||
if (message === undefined) return undefined;
|
||||
if (message === undefined) return goBackCommand && goBackCommand.execute();
|
||||
}
|
||||
|
||||
return await this.git.stashSave(this.git.repoPath, message, unstagedOnly);
|
||||
|
||||
Reference in New Issue
Block a user