Skip to content

Commit 2acdd3b

Browse files
authored
fix: Add "GIT_COMMITTER_*" to remove Git prompt (coder#1236)
1 parent e15566c commit 2acdd3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

agent/agent.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,11 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri
343343
executablePath = strings.ReplaceAll(executablePath, "\\", "/")
344344
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_SSH_COMMAND=%s gitssh --`, executablePath))
345345
// These prevent the user from having to specify _anything_ to successfully commit.
346+
// Both author and committer must be set!
346347
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_EMAIL=%s`, a.ownerEmail.Load()))
348+
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_EMAIL=%s`, a.ownerEmail.Load()))
347349
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_NAME=%s`, a.ownerUsername.Load()))
350+
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_NAME=%s`, a.ownerEmail.Load()))
348351

349352
// Load environment variables passed via the agent.
350353
// These should override all variables we manually specify.

0 commit comments

Comments
 (0)