Skip to content

Commit f9caddc

Browse files
fix(server): retain reflog-only submodule history during cleanup
1 parent c5975f5 commit f9caddc

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,13 @@ it.live("keeps unpushed submodule history after checkout and deinitialization",
635635
(yield* command(worktree, ["--git-dir", childGit, "show", "local-only:tracked.txt"]))
636636
.stdout,
637637
).toBe("unpublished work\n");
638+
yield* command(worktree, ["--git-dir", childGit, "branch", "-D", "local-only"]);
639+
expect(
640+
(yield* service.runNow).entries.find((entry) => entry.path === worktree),
641+
).toMatchObject({ outcome: "kept", reason: expect.stringContaining("remote-tracking") });
642+
expect(
643+
(yield* command(worktree, ["--git-dir", childGit, "show", `${local}:tracked.txt`])).stdout,
644+
).toBe("unpublished work\n");
638645
}),
639646
),
640647
);

‎apps/server/src/storageCleanup.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ const make = Effect.gen(function* () {
592592
"--max-count=1",
593593
"HEAD",
594594
"--all",
595+
"--reflog",
595596
"--not",
596597
"--remotes",
597598
]);

0 commit comments

Comments
 (0)