Adding git stash drop for issue 76195

This commit is contained in:
Drew Cross
2019-06-29 07:19:20 -07:00
parent 08ad050c27
commit a047914487
5 changed files with 49 additions and 0 deletions

View File

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