1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

treewide: replace manual MiB calculations with renderSize

This commit is contained in:
Marcel 2025-10-27 01:21:02 +01:00
parent f234633e27
commit 584a8e8a00
No known key found for this signature in database
GPG key ID: 446F3B093DF81C6A
3 changed files with 13 additions and 11 deletions

View file

@ -9,6 +9,7 @@
#include "nix/util/users.hh"
#include "nix/util/fs-sink.hh"
#include "nix/util/sync.hh"
#include "nix/util/util.hh"
#include <git2/attr.h>
#include <git2/blob.h>
@ -530,12 +531,12 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
auto act = (Activity *) payload;
act->result(
resFetchStatus,
fmt("%d/%d objects received, %d/%d deltas indexed, %.1f MiB",
fmt("%d/%d objects received, %d/%d deltas indexed, %s",
stats->received_objects,
stats->total_objects,
stats->indexed_deltas,
stats->total_deltas,
stats->received_bytes / (1024.0 * 1024.0)));
renderSize(stats->received_bytes)));
return getInterrupted() ? -1 : 0;
}