mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
ssh: Fix progress bar crash when there are zero items to send.
* guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is zero.
This commit is contained in:
parent
de83660dd3
commit
44c6e6f590
1 changed files with 9 additions and 8 deletions
|
@ -441,6 +441,7 @@ (define (display-bar %)
|
|||
(progress-bar % (- (max (current-terminal-columns) 5) 5)))
|
||||
(force-output port))
|
||||
|
||||
(unless (zero? total)
|
||||
(let ((% (* 100. (/ sent total))))
|
||||
(match (vhash-assoc item sizes)
|
||||
(#f
|
||||
|
@ -448,7 +449,7 @@ (define (display-bar %)
|
|||
(values port sizes total sent))
|
||||
((_ . size)
|
||||
(display-bar %)
|
||||
(values port sizes total (+ sent size))))))
|
||||
(values port sizes total (+ sent size)))))))
|
||||
|
||||
(define (notify-transfer-completion port . args)
|
||||
"Notify the user that the transfer has completed."
|
||||
|
|
Loading…
Reference in a new issue