Skip to content

Commit 45a34e4

Browse files
maria-rcksnateEc
andcommitted
fix(server): allow cleanup of old-form registered submodules
Co-authored-by: Yukun Shan <[email protected]>
1 parent 3c3546f commit 45a34e4

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎apps/server/src/storageCleanup.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ it.live("removes clean submodules recursively, including deinitialized repositor
605605
repo,
606606
"stored",
607607
]);
608+
const legacy = `${worktree}/legacy`;
609+
yield* command(repo, ["clone", "--no-hardlinks", repo, legacy]);
610+
yield* command(worktree, ["submodule", "add", repo, "legacy"]);
611+
expect((yield* fs.stat(`${legacy}/.git`)).type).toBe("Directory");
608612
yield* recordSubmodules();
609613
yield* command(submodule, ["submodule", "deinit", "stored"]);
610614
const admin = (yield* command(worktree, ["rev-parse", "--absolute-git-dir"])).stdout.trim();

‎apps/server/src/storageCleanup.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,10 @@ const make = Effect.gen(function* () {
298298
maxOutputBytes: 64 * 1024,
299299
});
300300
if (submodules.stdoutTruncated || submodules.stderrTruncated) return incomplete;
301-
for (const submodule of submodules.stdout.split("\0").filter(Boolean))
301+
for (const submodule of submodules.stdout.split("\0").filter(Boolean)) {
302302
repositories.add(pathKey(path.resolve(submodule)));
303+
repositories.add(pathKey(path.resolve(submodule, ".git")));
304+
}
303305
}
304306
const pending = [root];
305307
let entries = 1;

0 commit comments

Comments
 (0)