From ea72c729987af58de2b1d3579f52a1830b927b45 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 28 Apr 2026 13:22:33 +0700 Subject: [PATCH] test(server): codify subfolder of archived git repo stays as directory workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user archives a git repo and later opens a subfolder of it that is not its own git project, the resulting workspace is a directory — not a revived git workspace pointing at the archived parent. To get git features back the user unarchives the parent (S6/S11). --- ...on.workspace-resolution-invariants.test.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/server/src/server/session.workspace-resolution-invariants.test.ts b/packages/server/src/server/session.workspace-resolution-invariants.test.ts index 88ca9a6c8..63b99b856 100644 --- a/packages/server/src/server/session.workspace-resolution-invariants.test.ts +++ b/packages/server/src/server/session.workspace-resolution-invariants.test.ts @@ -443,3 +443,26 @@ test("S12: findWorkspaceByDirectory does not return archived ancestor via prefix ).findWorkspaceByDirectory("/parent/child"); expect(found).toBeNull(); }); + +// ───────────────────────────────────────────────────────────────────────────── +// S13. Open a subfolder of an archived git repo when that subfolder is not +// itself a separate git project: the new workspace is a plain directory. +// +// Archive is sticky (S9). The archived parent is out of scope, so there is +// no git project that owns the subfolder. Reviving the parent or inventing +// a second git project pointing at the same repo would both be worse than +// being explicit. To get git features back the user unarchives the parent +// (S6/S11). +// ───────────────────────────────────────────────────────────────────────────── +test("S13: subfolder of an archived git repo opens as a directory workspace", async () => { + const archivedAt = "2026-04-22T13:08:05.400Z"; + const h = createHarness({ + workspaces: [gitWorkspace("/toolbox", archivedAt)], + projects: [gitProject("/toolbox", archivedAt)], + gitRoots: ["/toolbox"], + }); + await openProject(h.session, "/toolbox/flomo-cli"); + const resp = getOpenResponse(h.emitted, "req-1"); + expect(resp?.error).toBeNull(); + expect(resp?.workspace?.workspaceKind).toBe("directory"); +});