Skip to content

Commit b73e16c

Browse files
committed
Fix: wrap provider resolution in Effect pipeline so fallback to 'main' is reachable
The inner `yield* sourceControlProvider(cwd)` could fail before `.getDefaultBranch()` was called, bypassing the Effect.catch handler and preventing the graceful fallback to "main". By piping the provider resolution through Effect.flatMap and wrapping the entire chain with Effect.catch, both provider-resolution failures and getDefaultBranch failures now correctly fall through to the "main" default.
1 parent ec55eef commit b73e16c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/server/src/git/GitManager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,9 +1045,10 @@ export const makeGitManager = Effect.fn("makeGitManager")(function* () {
10451045
}
10461046
}
10471047

1048-
const defaultFromProvider = yield* (yield* sourceControlProvider(cwd))
1049-
.getDefaultBranch({ cwd })
1050-
.pipe(Effect.catch(() => Effect.succeed(null)));
1048+
const defaultFromProvider = yield* sourceControlProvider(cwd).pipe(
1049+
Effect.flatMap((provider) => provider.getDefaultBranch({ cwd })),
1050+
Effect.catch(() => Effect.succeed(null)),
1051+
);
10511052
if (defaultFromProvider) {
10521053
return defaultFromProvider;
10531054
}

0 commit comments

Comments
 (0)