Skip to content

Commit 8f76cb4

Browse files
fix: honor cmd.Env when probing core.sshCommand
Pass the prepared command environment into the SSH config probe so GIT_CONFIG_* isolation (and any custom Env) is respected when deciding whether to inject fail-fast GIT_SSH_COMMAND. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
1 parent bed18ab commit 8f76cb4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎internal/git/network_env.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func repoHasCoreSSHCommand(repoDir string, env []string) bool {
5353
if strings.TrimSpace(repoDir) == "" {
5454
return false
5555
}
56-
cmd := exec.Command("git", "-C", repoDir, "config", "--get", "core.sshCommand")
57-
cmd.Env = env
58-
out, err := cmd.Output()
56+
probe := exec.Command("git", "-C", repoDir, "config", "--get", "core.sshCommand")
57+
probe.Env = env
58+
out, err := probe.Output()
5959
return err == nil && strings.TrimSpace(string(out)) != ""
6060
}

0 commit comments

Comments
 (0)