- Deduplicate terminal IDs and favorite model slugs with trim-aware iteration - Use effect-based filtering for local branch and built-in model lists - Switch stable array handling to non-mutating `toSorted`
Showing the changes to packages/shared/src/git.ts (1 of 8 files). Show all
Unified · Split
| @@ -6,8 +6,10 @@ import type { · 5 unmodified lines | ||
| 6 | 6 | VcsStatusResult, |
| 7 | 7 | VcsStatusStreamEvent, |
| 8 | 8 | } from "@t3tools/contracts"; |
| 9 | +import * as Arr from "effect/Array"; | |
| 9 | 10 | import * as Effect from "effect/Effect"; |
| 10 | 11 | import * as Random from "effect/Random"; |
| 12 | +import * as Result from "effect/Result"; | |
| 11 | 13 | import { detectSourceControlProviderFromRemoteUrl } from "./sourceControl.ts"; |
| 12 | 14 | |
| 13 | 15 | export const WORKTREE_BRANCH_PREFIX = "t3code"; |
| @@ -172,7 +174,9 @@ export function dedupeRemoteBranchesWithLocalMatches( · 158 unmodified lines | ||
| 172 | 174 | refs: ReadonlyArray<VcsRef>, |
| 173 | 175 | ): ReadonlyArray<VcsRef> { |
| 174 | 176 | const localBranchNames = new Set( |
| 175 | − refs.filter((refName) => !refName.isRemote).map((refName) => refName.name), | |
| 177 | + Arr.filterMap(refs, (refName) => | |
| 178 | + refName.isRemote ? Result.failVoid : Result.succeed(refName.name), | |
| 179 | + ), | |
| 176 | 180 | ); |
| 177 | 181 | |
| 178 | 182 | return refs.filter((refName) => { |