Skip to content

Commit 5e2a3e9

Browse files
Fix reversed remote fallback and missing PR item filter guard
- Remove .toReversed() from listRemoteNames so resolvePrimaryRemoteName falls back to the most-significant remote (consistent with parseRemoteNames usage elsewhere) - Add explicit checkoutPullRequestItemValue guard in filteredBranchPickerItems filter and include it in the useMemo dependency array Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
1 parent 2cc7c13 commit 5e2a3e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/server/src/git/Layers/GitCore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ const makeGitCore = Effect.gen(function* () {
420420

421421
const listRemoteNames = (cwd: string): Effect.Effect<ReadonlyArray<string>, GitCommandError> =>
422422
runGitStdout("GitCore.listRemoteNames", cwd, ["remote"]).pipe(
423-
Effect.map((stdout) => parseRemoteNames(stdout).toReversed()),
423+
Effect.map((stdout) => parseRemoteNames(stdout)),
424424
);
425425

426426
const resolvePrimaryRemoteName = (cwd: string): Effect.Effect<string, GitCommandError> =>

apps/web/src/components/BranchToolbarBranchSelector.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ export function BranchToolbarBranchSelector({
126126
? branchPickerItems
127127
: branchPickerItems.filter((itemValue) => {
128128
if (createBranchItemValue && itemValue === createBranchItemValue) return true;
129+
if (checkoutPullRequestItemValue && itemValue === checkoutPullRequestItemValue) return true;
129130
return itemValue.toLowerCase().includes(normalizedBranchQuery);
130131
}),
131-
[branchPickerItems, createBranchItemValue, normalizedBranchQuery],
132+
[branchPickerItems, checkoutPullRequestItemValue, createBranchItemValue, normalizedBranchQuery],
132133
);
133134
const [resolvedActiveBranch, setOptimisticBranch] = useOptimistic(
134135
canonicalActiveBranch,

0 commit comments

Comments
 (0)