Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): let t3.json limit or disable submodule init in new worktrees #12953

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/12953/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 105 additions and 3 deletions (loading 6).

x
0 of 9 viewed, 9 left
2 additions and 0 deletionsapps/server/src/vcs/GitVcsDriver.tsModified
View file
@@ -128,6 +128,8 @@
total: number;
}) => Effect.Effect<void, never>;
readonly onSubmodulesStarted?: () => Effect.Effect<void, never>;
+ /** Fires when `.gitmodules` exists but t3.json sets `worktreeSubmodules` to `"none"`. */
+ readonly onSubmodulesDisabled?: () => Effect.Effect<void, never>;
readonly onSubmoduleLine?: (line: string) => Effect.Effect<void, never>;
readonly onSubmodulesFinished?: (input: {
ok: boolean;
78 additions and 0 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -2353,6 +2353,84 @@
+ it.effect("honors the t3.json worktreeSubmodules setting", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const pathService = yield* Path.Path;
+​
+ const previousAllowedProtocol = process.env.GIT_ALLOW_PROTOCOL;
+ process.env.GIT_ALLOW_PROTOCOL = "file";
+ yield* Effect.addFinalizer(() =>
+ Effect.sync(() => {
+ if (previousAllowedProtocol === undefined) {
+ delete process.env.GIT_ALLOW_PROTOCOL;
+ } else {
+ process.env.GIT_ALLOW_PROTOCOL = previousAllowedProtocol;