Git - auto stash should restore the stash when the operation fails (#232929) (#236059)

This commit is contained in:
Ladislau Szomoru
2024-12-13 17:21:25 +01:00
committed by GitHub
parent 974044db9b
commit 4b254c2da5

View File

@@ -2465,10 +2465,12 @@ export class Repository implements Disposable {
}
await this.repository.createStash(undefined, true);
const result = await runOperation();
await this.repository.popStash();
return result;
try {
const result = await runOperation();
return result;
} finally {
await this.repository.popStash();
}
}
private onFileChange(_uri: Uri): void {