The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 19:15 UTC
fix(server): honor submodule settings when creating worktrees (#15594)
Rahul Mishra committed
Oct 5, 2026 at 22:47 UTC
3e6b45028ceec5820dacb37dc3852470ebdc9411
2 files changed
+21
-1
apps/server/src/git/GitManager.ts
+20
@@ -35,6 +35,8 @@ import {
35
type SourceControlProviderKind,
36
type SourceControlWritingStyleSettings,
37
type ThreadId,
38
+ type VcsCreateWorktreeInput,
39
+ type VcsCreateWorktreeResult,
40
} from "@t3tools/contracts";
41
import {
42
hasProjectSettingsOverrides,
@@ -103,6 +105,10 @@ interface SourceControlTextGenerationSettings {
105
export class GitManager extends Context.Service<
106
GitManager,
107
{
108
+ readonly createWorktree: (
109
+ input: VcsCreateWorktreeInput,
110
+ options?: GitVcsDriver.CreateWorktreeOptions,
111
+ ) => Effect.Effect<VcsCreateWorktreeResult, GitCommandError>;
112
readonly status: (
113
input: VcsStatusInput,
114
) => Effect.Effect<VcsStatusResult, GitManagerServiceError>;
@@ -727,6 +733,19 @@ export const make = Effect.gen(function* () {
733
);
734
return resolveProjectSettings(settings, projectId).settings;
735
});
736
+ const createWorktree: GitManager["Service"]["createWorktree"] = Effect.fn(
737
+ "GitManager.createWorktree",
738
+ )(function* (input, options) {
739
+ const submodules =
740
+ options?.submodules !== undefined
741
+ ? options.submodules
742
+ : yield* projectSettingsFor(input).pipe(
743
+ Effect.map((settings) => settings.worktreeSubmodules),
744
+ Effect.orElseSucceed(() => null),
745
+ );
746
+ return yield* gitCore.createWorktree(input, { ...options, submodules });
747
+ });
748
+
749
const readRepositoryInstructions = (cwd: string, fileName: string) =>
750
Effect.gen(function* () {
751
const root = yield* fileSystem.realPath(cwd);
@@ -2849,6 +2868,7 @@ export const make = Effect.gen(function* () {
2868
);
2869
2870
return GitManager.of({
2871
+ createWorktree,
2872
localStatus,
2873
remoteStatus,
2874
status,
apps/server/src/git/GitWorkflowService.ts
+1
-1
@@ -347,7 +347,7 @@ export const make = Effect.gen(function* () {
347
),
348
createWorktree: (input, options) =>
349
ensureGitCommand("GitWorkflowService.createWorktree", input.cwd).pipe(
350
- Effect.andThen(git.createWorktree(input, options)),
350
+ Effect.andThen(gitManager.createWorktree(input, options)),
351
),
352
listLocalBranchNames: (cwd) =>
353
ensureGitCommand("GitWorkflowService.listLocalBranchNames", cwd).pipe(