Adds go back support to stash apply, delete, & save

This commit is contained in:
Eric Amodio
2017-04-09 01:18:45 -04:00
parent 3aab904aaf
commit 4707b0640d
6 changed files with 31 additions and 19 deletions

View File

@@ -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);