Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use g for formatting floating point timeouts
The timeout error message formats `timeout` with `%d`, but `kill_after_timeout` is typed as `float` and is commonly passed as a non-integer (e.g., 0.1). This can produce a misleading message (truncation to 0) and may raise a formatting error depending on Python behavior. Format it as a float (or generic number) instead.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
  • Loading branch information
Byron and Copilot authored Jul 26, 2026
commit 484b3dfe67666dcbc44bc9612749f8727e0f3797
5 changes: 1 addition & 4 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,10 +1473,7 @@ def kill_process(pid: int) -> None:
return

def make_timeout_error() -> Union[str, bytes]:
err = 'Timeout: the command "%s" did not complete in %d secs.' % (
" ".join(redacted_command),
timeout,
)
err = f'Timeout: the command "{" ".join(redacted_command)}" did not complete in {timeout:g} secs.'
return err if universal_newlines else err.encode(defenc)
Comment thread
Byron marked this conversation as resolved.

def communicate() -> Tuple[AnyStr, AnyStr]:
Expand Down
Loading