Skip to main content

apply_git_timeout

Function apply_git_timeout 

Source
pub fn apply_git_timeout(cmd: &mut Command, secs: u64) -> &mut Command
Expand description

Apply TCP connection and auth/transfer timeouts to a git command.

Sets three timeout mechanisms to prevent indefinite hangs (#449, #453):

  • GIT_CONNECT_TIMEOUT: TCP handshake timeout
  • GIT_SSH_COMMAND: SSH auth negotiation timeout via -o ConnectTimeout and -o BatchMode=yes (non-interactive). Only sets this env var if not already present, preserving any user-configured SSH identity files, ProxyJump, or other customizations.
  • http.lowSpeedTime and http.lowSpeedLimit: HTTP pack transfer stall timeout