Skip to content

Commit e4920a3

Browse files
committed
Fix: forward env parameter through gitCommand to VcsProcess
The execute method in GitVcsDriver and the gitCommand helper were not forwarding the env field from the input to process.run. This caused CheckpointStore.captureCheckpoint's GIT_INDEX_FILE, GIT_AUTHOR_*, and GIT_COMMITTER_* environment variables to be silently dropped, resulting in checkpoint operations mutating the user's real staging area instead of an isolated temporary index.
1 parent ffc20e0 commit e4920a3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/server/src/vcs/GitVcsDriver.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ const gitCommand = (
257257
args: ReadonlyArray<string>,
258258
options?: {
259259
readonly stdin?: string;
260+
readonly env?: NodeJS.ProcessEnv;
260261
readonly allowNonZeroExit?: boolean;
261262
readonly timeoutMs?: number;
262263
readonly maxOutputBytes?: number;
@@ -269,6 +270,7 @@ const gitCommand = (
269270
args,
270271
cwd,
271272
...(options?.stdin !== undefined ? { stdin: options.stdin } : {}),
273+
...(options?.env !== undefined ? { env: options.env } : {}),
272274
...(options?.allowNonZeroExit !== undefined
273275
? { allowNonZeroExit: options.allowNonZeroExit }
274276
: {}),
@@ -305,6 +307,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
305307
const execute: VcsDriverShape["execute"] = (input) =>
306308
gitCommand(process, input.operation, input.cwd, input.args, {
307309
...(input.stdin !== undefined ? { stdin: input.stdin } : {}),
310+
...(input.env !== undefined ? { env: input.env } : {}),
308311
...(input.allowNonZeroExit !== undefined ? { allowNonZeroExit: input.allowNonZeroExit } : {}),
309312
...(input.timeoutMs !== undefined ? { timeoutMs: input.timeoutMs } : {}),
310313
...(input.maxOutputBytes !== undefined ? { maxOutputBytes: input.maxOutputBytes } : {}),

0 commit comments

Comments
 (0)