Skip to content

Commit

Permalink
Fixes issue w/ worktree status hanging
Browse files Browse the repository at this point in the history
If a worktree status fails we weren't properly propegating the error
  • Loading branch information
eamodio committed May 16, 2024
1 parent 4cbc432 commit e616d7b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/git/models/worktree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ export class GitWorktree {

if (this._statusPromise == null || options?.force) {
// eslint-disable-next-line no-async-promise-executor
this._statusPromise = new Promise(async resolve => {
const status = await Container.instance.git.getStatusForRepo(this.uri.fsPath);
this._status = status;
resolve(status);
this._statusPromise = new Promise(async (resolve, reject) => {
try {
const status = await Container.instance.git.getStatusForRepo(this.uri.fsPath);
this._status = status;
resolve(status);
} catch (ex) {
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(ex);
}
});
}
return this._statusPromise;
Expand Down

0 comments on commit e616d7b

Please sign in to comment.