Skip to content

Commit e522b11

Browse files
committed
fix(server): use branch-aware PR lookup for push notifications
1 parent 8d5aa2a commit e522b11

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/server/src/git/GitManager.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,11 +1682,13 @@ export const make = Effect.gen(function* () {
16821682
finalBranchContext?.hasUpstream === true;
16831683

16841684
if (shouldLookupExistingOpenPr && finalBranchContext) {
1685-
latestOpenPr = yield* resolveBranchHeadContext(cwd, {
1685+
latestOpenPr = yield* resolveLookupHeadContext(cwd, {
16861686
branch: finalBranchContext.branch,
16871687
upstreamRef: finalBranchContext.upstreamRef,
16881688
}).pipe(
1689-
Effect.flatMap((headContext) => findOpenPr(cwd, headContext)),
1689+
Effect.flatMap(({ headContext, lookup }) =>
1690+
lookup ? findOpenPr(cwd, headContext) : Effect.succeed(null),
1691+
),
16901692
Effect.orElseSucceed(() => null),
16911693
);
16921694
}

0 commit comments

Comments
 (0)