fix(server): the Welcome page offers repositories you only worked on in worktrees #33923
Mergeddominikzabcik(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/33923/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -923,5 +928,11 @@923928 );924929 for (const { directory, gitDir, linkedWorktree } of repositories) {925930 const configText = configTexts.get(path.join(gitDir, "config")) ?? "";931+ const originUrl = parseOriginUrlFromGitConfig(configText);932+ const git: AgentSessionProjectGit = {933+ remoteKey:934+ originUrl === null ? null : sourceControlDefinitions.repositoryKeyFromRemote(originUrl),935+ repository: repositoryPathFromRemoteUrl(originUrl),936+ };926937 // Bare repositories have no main checkout, so offer their linked worktrees independently.927938 if (linkedWorktree && !isBareGitConfig(configText)) {@@ -1568,12 +1582,17 @@1568158215691583 for (const candidate of raw) {15701584 const expanded = expandHomePath(candidate.cwd.trim(), homeDir);15711585 if (!path.isAbsolute(expanded)) continue;15721586 const resolved = path.resolve(expanded);15731587 const stats = directories.get(resolved);15741588 if (stats === undefined || Option.isNone(stats)) continue;1575- let key = directoryKeys.get(resolved);1576- if (key === undefined) {1589+ let project = directoryProjects.get(resolved);1590+ if (project === undefined) {15771591 const gitIdentity = directoryGitIdentities.get(resolved);1578- if (gitIdentity === undefined || gitIdentity._tag === "Worktree") {1579- key = "";1592+ if (gitIdentity === undefined) {1593+ project = null;1594+ } else if (gitIdentity._tag === "Worktree") {1595+ // A linked worktree's sessions count toward its main checkout's project.1596+ const { mainCheckout } = gitIdentity;1597+ const mainStats =1598+ mainCheckout === null || isExcludedProjectPath(mainCheckout)
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
tanstack-source added labelsbug
juliusmarminge merged thisd46b90c
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed