mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Adding git stash drop for issue 76195
This commit is contained in:
@@ -1526,6 +1526,24 @@ export class Repository {
|
||||
}
|
||||
}
|
||||
|
||||
async dropStash(index?: number): Promise<void> {
|
||||
const args = ['stash', 'drop'];
|
||||
|
||||
try {
|
||||
if (typeof index === 'number') {
|
||||
args.push(`stash@{${index}}`);
|
||||
|
||||
await this.run(args);
|
||||
}
|
||||
} catch (err) {
|
||||
if (/No stash found/.test(err.stderr || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.NoStashFound;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
getStatus(limit = 5000): Promise<{ status: IFileStatus[]; didHitLimit: boolean; }> {
|
||||
return new Promise<{ status: IFileStatus[]; didHitLimit: boolean; }>((c, e) => {
|
||||
const parser = new GitStatusParser();
|
||||
|
||||
Reference in New Issue
Block a user