mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Git - add option to restore staged changes when aplying/popping a stash (#278556)
This commit is contained in:
@@ -2461,13 +2461,19 @@ export class Repository {
|
||||
}
|
||||
}
|
||||
|
||||
async popStash(index?: number): Promise<void> {
|
||||
async popStash(index?: number, options?: { reinstateStagedChanges?: boolean }): Promise<void> {
|
||||
const args = ['stash', 'pop'];
|
||||
if (options?.reinstateStagedChanges) {
|
||||
args.push('--index');
|
||||
}
|
||||
await this.popOrApplyStash(args, index);
|
||||
}
|
||||
|
||||
async applyStash(index?: number): Promise<void> {
|
||||
async applyStash(index?: number, options?: { reinstateStagedChanges?: boolean }): Promise<void> {
|
||||
const args = ['stash', 'apply'];
|
||||
if (options?.reinstateStagedChanges) {
|
||||
args.push('--index');
|
||||
}
|
||||
await this.popOrApplyStash(args, index);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user