Skip to content

Commit 26aa1b7

Browse files
perf(server): simplify deferred comparison base candidates
1 parent efe4de9 commit 26aa1b7

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎apps/server/src/vcs/GitVcsDriverCore.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,6 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
16871687
refName: string,
16881688
options?: {
16891689
readonly allowRemoteOfCurrent?: boolean;
1690-
/** Null can mean a failed lookup, so only a successful value skips the retry. */
16911690
readonly knownOriginDefaultBranch?: string | null;
16921691
},
16931692
) {
@@ -1706,7 +1705,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
17061705
Effect.orElseSucceed(() => null),
17071706
);
17081707
const candidates = [
1709-
Effect.succeed(configuredBaseBranch.length > 0 ? configuredBaseBranch : null),
1708+
Effect.succeed(configuredBaseBranch),
17101709
primaryRemoteName === null
17111710
? Effect.succeed(null)
17121711
: primaryRemoteName === "origin" && options?.knownOriginDefaultBranch != null
@@ -1716,7 +1715,6 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
17161715
];
17171716

17181717
for (const readCandidate of candidates) {
1719-
// Resolve the remote default only if the configured base could not be used.
17201718
const candidate = yield* readCandidate;
17211719
if (!candidate) {
17221720
continue;

0 commit comments

Comments
 (0)