Skip to content
Source
Sign inSign up
pingdotgg/t3code

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 intomain fromrefs/pull/33923/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 65 additions and 6 deletions (loading 2).

x
0 of 3 viewed, 3 left
65 additions and 6 deletionsapps/server/src/project/AgentSessionScanner.test.tsModified
View file
@@ -869,7 +869,7 @@
}),
​
- it.effect("skips linked git worktrees and reports the origin of real checkouts", () =>
+ it.effect("folds linked git worktrees into their checkout and reports real origins", () =>
Effect.gen(function* () {
const path = yield* Path.Path;
const fileSystem = yield* FileSystem.FileSystem;
@@ -905,8 +905,56 @@
path.join(submodule, ".git"),
`gitdir: ${submoduleGitDir}\n`,
+ // A repository whose sessions all ran in a linked worktree is still offered.
+ const worktreeOnly = yield* makeTempDir("t3code-workspace-worktree-only-");
+ const worktreeOnlyCheckout = yield* makeTempDir("t3code-workspace-worktree-only-wt-");
+ const worktreeOnlyGitDir = path.join(worktreeOnly, ".git", "worktrees", "wt");
+ yield* fileSystem.makeDirectory(worktreeOnlyGitDir, { recursive: true });
+ yield* fileSystem.writeFileString(
+ path.join(worktreeOnly, ".git", "config"),
+ '[remote "origin"]\n\turl = git@github.com:pingdotgg/other.git\n',
+ );
+ yield* fileSystem.writeFileString(path.join(worktreeOnlyGitDir, "commondir"), "../..\n");
+ yield* fileSystem.writeFileString(
+ path.join(worktreeOnlyCheckout, ".git"),
+ `gitdir: ${worktreeOnlyGitDir}\n`,
+ );
+​
+ // Not offered: the config is unreadable, so the repository could be bare; and