path: root/csum-file.h
diff options
authorNicolas Pitre <>2007-11-04 04:22:42 (GMT)
committerJunio C Hamano <>2007-11-04 08:56:53 (GMT)
commitebe8fa738dcf6911fe520adce0cfa0cb26dee5e2 (patch)
treecb9a5efcdacf9548e05a705238bf964545eecda3 /csum-file.h
parent140dd77a5cb2e61dcb942e245a2474fae95e42a5 (diff)
fix display overlap between remote and local progress
It is possible for the remote summary line to be displayed over the local progress display line, and therefore that local progress gets bumped to the next line. However, if the progress line is long enough, it might not be entirely overwritten by the remote summary line. This creates a messed up display such as: remote: Total 310 (delta 160), reused 178 (delta 112)iB/s Receiving objects: 100% (310/310), 379.98 KiB | 136 KiB/s, done. So we have to clear the screen line before displaying the remote message to make sure the local progress is not visible anymore on the first line. Yet some Git versions on the remote side might be sending updates to the same line and terminate it with \r, and a separate packet with a single \n might be sent later when the progress display is done. This means the screen line must *not* be cleared in that case. Since the sideband code already has to figure out line breaks in the received packet to properly prepend the "remote:" prefix, we can easily determine if the remote line about to be displayed is empty. Only when it is not then a proper suffix is inserted before the \r or \n to clear the end of the screen line. Also some magic constants related to the prefix length have been replaced with a variable, making it similar to the suffix length handling. Since gcc is smart enough to detect that the variable is constant there is no impact on the generated code. Signed-off-by: Nicolas Pitre <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'csum-file.h')
0 files changed, 0 insertions, 0 deletions