fix compile errors

This commit is contained in:
Joao Moreno
2019-10-25 11:36:06 +02:00
parent 980fb4b0ff
commit 2c0115ec8c

View File

@@ -1597,15 +1597,15 @@ export class Repository {
}
}
async dropStash(index: number): Promise<void> {
async dropStash(index?: number): Promise<void> {
const args = ['stash', 'drop'];
if (typeof index === 'number') {
args.push(`stash@{${index}}`);
}
try {
await this.run(args);
}
try {
await this.run(args);
} catch (err) {
if (/No stash found/.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.NoStashFound;