Skip to content

Commit 6506f41

Browse files
committed
Fix: forward env field from execute to gitCommand in GitVcsDriver
The execute method in GitVcsDriver was silently dropping the env field from its input when calling gitCommand, and gitCommand's options type didn't include env at all. This broke CheckpointStore.captureCheckpoint which passes GIT_INDEX_FILE and author/committer overrides via env, causing checkpoint git operations to use the user's real index instead of the temporary one.
1 parent 0bf7fab commit 6506f41

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/server/src/vcs/Layers/GitVcsDriver.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const gitCommand = (
6969
args: ReadonlyArray<string>,
7070
options?: {
7171
readonly stdin?: string;
72+
readonly env?: NodeJS.ProcessEnv;
7273
readonly allowNonZeroExit?: boolean;
7374
readonly timeoutMs?: number;
7475
readonly maxOutputBytes?: number;
@@ -81,6 +82,7 @@ const gitCommand = (
8182
args,
8283
cwd,
8384
...(options?.stdin !== undefined ? { stdin: options.stdin } : {}),
85+
...(options?.env !== undefined ? { env: options.env } : {}),
8486
...(options?.allowNonZeroExit !== undefined
8587
? { allowNonZeroExit: options.allowNonZeroExit }
8688
: {}),
@@ -118,6 +120,7 @@ export const makeGitVcsDriver = Effect.fn("makeGitVcsDriver")(function* () {
118120
const execute: VcsDriverShape["execute"] = (input) =>
119121
gitCommand(process, input.operation, input.cwd, input.args, {
120122
...(input.stdin !== undefined ? { stdin: input.stdin } : {}),
123+
...(input.env !== undefined ? { env: input.env } : {}),
121124
...(input.allowNonZeroExit !== undefined ? { allowNonZeroExit: input.allowNonZeroExit } : {}),
122125
...(input.timeoutMs !== undefined ? { timeoutMs: input.timeoutMs } : {}),
123126
...(input.maxOutputBytes !== undefined ? { maxOutputBytes: input.maxOutputBytes } : {}),

0 commit comments

Comments
 (0)