Skip to content

Commit c305191

Browse files
committed
Switches to Promise.allSettled
1 parent 3291964 commit c305191

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/env/node/git/sub-providers/worktrees.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { log } from '../../../../system/decorators/log';
1919
import { Logger } from '../../../../system/logger';
2020
import { getLogScope } from '../../../../system/logger.scope';
2121
import { joinPaths, normalizePath } from '../../../../system/path';
22+
import { getSettledValue } from '../../../../system/promise';
2223
import { interpolate } from '../../../../system/string';
2324
import type { Git } from '../git';
2425
import { GitErrors } from '../git';
@@ -101,12 +102,17 @@ export class WorktreesGitSubProvider implements GitWorktreesSubProvider {
101102
if (worktrees == null) {
102103
async function load(this: WorktreesGitSubProvider) {
103104
try {
104-
const [data, branches] = await Promise.all([
105+
const [dataResult, branchesResult] = await Promise.allSettled([
105106
this.git.exec({ cwd: repoPath }, 'worktree', 'list', '--porcelain'),
106107
this.provider.branches.getBranches(repoPath),
107108
]);
108109

109-
return parseGitWorktrees(this.container, data, repoPath, branches.values);
110+
return parseGitWorktrees(
111+
this.container,
112+
getSettledValue(dataResult, ''),
113+
repoPath,
114+
getSettledValue(branchesResult)?.values ?? [],
115+
);
110116
} catch (ex) {
111117
this.cache.worktrees?.delete(repoPath);
112118

0 commit comments

Comments
 (0)