fix(checkpoint): resolve core.sshCommand and respect explicit BatchMode

main

Commit

suhaanthayyil2mo ago

withBatchModeSSH only inspected GIT_SSH_COMMAND, so users who configure SSH via git config core.sshCommand had that setting silently overridden by the injected BatchMode default. Resolve the effective ssh command the way git does (GIT_SSH_COMMAND env > core.sshCommand > GIT_SSH > plain ssh) before deciding how to inject BatchMode.

Also replace the substring check for "BatchMode" with a proper option parser: matching any text containing "BatchMode" (e.g. BatchMode=no, or an unrelated substring) incorrectly skipped injection or defeated an explicit user choice. Now only an explicitly set BatchMode option (yes or no) is respected as-is; anything else gets BatchMode=yes injected.