Skip to content

Commit 832cfca

Browse files
fix(server): warn when an invalid t3.json falls back to recursive submodules
Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent f50c0f0 commit 832cfca

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/server/src/vcs/GitVcsDriverCore.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
23972397
) {
23982398
yield* writeTextFile(cwd, "t3.json", `{ "worktreeSubmodules": "${fileMode}" }`);
23992399
yield* git(cwd, ["add", "t3.json"]);
2400-
yield* git(cwd, ["commit", "--allow-empty", "-m", `submodules: ${fileMode}`]);
2400+
yield* git(cwd, ["commit", "-m", `submodules: ${fileMode}`]);
24012401
const worktreePath = pathService.join(worktreesDir, branch);
24022402
const disabled = yield* Ref.make(false);
24032403
yield* driver.createWorktree(

‎apps/server/src/vcs/GitVcsDriverCore.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3102,7 +3102,14 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
31023102
.pipe(Effect.orElseSucceed(() => false));
31033103
const submoduleMode = hasSubmodules
31043104
? yield* fileSystem.readFileString(path.join(worktreePath, T3_PROJECT_FILE_NAME)).pipe(
3105-
Effect.map((contents) => parseT3ProjectFile(contents)?.worktreeSubmodules ?? "recursive"),
3105+
Effect.flatMap((contents) => {
3106+
const file = parseT3ProjectFile(contents);
3107+
return file === null
3108+
? Effect.logWarning("t3.json is invalid; initializing submodules recursively", {
3109+
worktreePath,
3110+
}).pipe(Effect.as("recursive" as const))
3111+
: Effect.succeed(file.worktreeSubmodules ?? "recursive");
3112+
}),
31063113
Effect.orElseSucceed(() => "recursive" as const),
31073114
)
31083115
: "none";

0 commit comments

Comments
 (0)