authorgravatar for blankparticle@gmail.comRahul Mishra <blankparticle@gmail.com> 2026-10-05 22:47:13+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-05 17:17:13+00:00
log3e6b45028ceec5820dacb37dc3852470ebdc9411
tree3867ca3f501d375699de58430981ca756ea9278b
parent9d029a1df25126745dd70ac561ff25d3f8fbac42
signature Signed by PGP key B5690EEEBB952194

fix(server): honor submodule settings when creating worktrees (#15594)


2 files changed, 21 insertions(+), 1 deletions(-)

apps/server/src/git/GitManager.ts+20
......@@ -35,6 +35,8 @@ import {
3535 type SourceControlProviderKind,
3636 type SourceControlWritingStyleSettings,
3737 type ThreadId,
38 type VcsCreateWorktreeInput,
39 type VcsCreateWorktreeResult,
3840} from "@t3tools/contracts";
3941import {
4042 hasProjectSettingsOverrides,
......@@ -103,6 +105,10 @@ interface SourceControlTextGenerationSettings {
103105export class GitManager extends Context.Service<
104106 GitManager,
105107 {
108 readonly createWorktree: (
109 input: VcsCreateWorktreeInput,
110 options?: GitVcsDriver.CreateWorktreeOptions,
111 ) => Effect.Effect<VcsCreateWorktreeResult, GitCommandError>;
106112 readonly status: (
107113 input: VcsStatusInput,
108114 ) => Effect.Effect<VcsStatusResult, GitManagerServiceError>;
......@@ -727,6 +733,19 @@ export const make = Effect.gen(function* () {
727733 );
728734 return resolveProjectSettings(settings, projectId).settings;
729735 });
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
730749 const readRepositoryInstructions = (cwd: string, fileName: string) =>
731750 Effect.gen(function* () {
732751 const root = yield* fileSystem.realPath(cwd);
......@@ -2849,6 +2868,7 @@ export const make = Effect.gen(function* () {
28492868 );
28502869
28512870 return GitManager.of({
2871 createWorktree,
28522872 localStatus,
28532873 remoteStatus,
28542874 status,
apps/server/src/git/GitWorkflowService.ts+1-1
......@@ -347,7 +347,7 @@ export const make = Effect.gen(function* () {
347347 ),
348348 createWorktree: (input, options) =>
349349 ensureGitCommand("GitWorkflowService.createWorktree", input.cwd).pipe(
350 Effect.andThen(git.createWorktree(input, options)),
350 Effect.andThen(gitManager.createWorktree(input, options)),
351351 ),
352352 listLocalBranchNames: (cwd) =>
353353 ensureGitCommand("GitWorkflowService.listLocalBranchNames", cwd).pipe(