1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

treewide: replace manual MiB calculations with renderSize

(cherry picked from commit 584a8e8a00)
This commit is contained in:
Marcel 2025-10-27 01:21:02 +01:00 committed by github-actions[bot]
parent a5a7769d84
commit f1b04c95ac
3 changed files with 13 additions and 11 deletions

View file

@ -8,6 +8,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>
@ -517,12 +518,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;
}