Skip to content

Commit 0b1e3a5

Browse files
committed
break after finding the first GIT_SSH_COMMAND
Add a break after removing GIT_SSH_COMMAND from the env slice. While this version works and takes the last GIT_SSH_COMMAND line in the slice, the re-assignment and re-swap looks confusing. We shouldn't get betting duplicate env vars anyway, and this appears like it's a bug, and is likely to confuse someone later. Just break early as expected.
1 parent ec2657d commit 0b1e3a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

get_git.go

+1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) {
193193

194194
env[i], env[len(env)-1] = env[len(env)-1], env[i]
195195
env = env[:len(env)-1]
196+
break
196197
}
197198
}
198199

0 commit comments

Comments
 (0)