Skip to content
  • Antoine Pelisse's avatar
    strbuf: create strbuf_humanise_bytes() to show byte sizes · 079b546a
    Antoine Pelisse authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Humanization of downloaded size is done in the same function as text
    formatting in 'process.c'. The code cannot be reused easily elsewhere.
    
    Separate text formatting from size simplification and make the
    function public in strbuf so that it can easily be used by other
    callers.
    
    We now can use strbuf_humanise_bytes() for both downloaded size and
    download speed calculation. One of the drawbacks is that speed will
    now look like this when download is stalled: "0 bytes/s" instead of
    "0 KiB/s".
    
    Signed-off-by: default avatarAntoine Pelisse <apelisse@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    079b546a