diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-10-14 01:54:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-14 01:54:51 -0700 |
commit | 18a536476e68349bacab7ddf84166a907dd0bede (patch) | |
tree | 0ebfa3405777e23c57898d7198501504eba8658e /progress.c | |
parent | 9ecb2a7f496413b9a6404e4a19f7edee029819b8 (diff) | |
parent | 583371af1f88e9cd48fedbb6bbb147d8091fd591 (diff) | |
download | git-18a536476e68349bacab7ddf84166a907dd0bede.tar.gz |
Merge branch 'maint'
* maint:
change throughput display units with fast links
clone: Supply the right commit hash to post-checkout when -b is used
remote-curl: add missing initialization of argv0_path
Diffstat (limited to 'progress.c')
-rw-r--r-- | progress.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/progress.c b/progress.c index 132ed95a3d..3971f49f4d 100644 --- a/progress.c +++ b/progress.c @@ -131,7 +131,13 @@ static void throughput_string(struct throughput *tp, off_t total, } else { l -= snprintf(tp->display, l, ", %u bytes", (int)total); } - if (rate) + + if (rate > 1 << 10) { + int x = rate + 5; /* for rounding */ + snprintf(tp->display + sizeof(tp->display) - l, l, + " | %u.%2.2u MiB/s", + x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10); + } else if (rate) snprintf(tp->display + sizeof(tp->display) - l, l, " | %u KiB/s", rate); } |