index c370c7f834f69ba69d5366d47aadab3b6162b095..1e51865c52231e80cfdbbb19c8b6fa86ee8855d2 100644 (file)
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
offset = 0;
}
do {
offset = 0;
}
do {
- int ret = xread(0, buffer + len, sizeof(buffer) - len);
+ ssize_t ret = xread(0, buffer + len, sizeof(buffer) - len);
if (ret <= 0) {
if (!ret)
die("early EOF");
if (ret <= 0) {
if (!ret)
die("early EOF");
static void unpack_all(void)
{
int i;
static void unpack_all(void)
{
int i;
- struct progress progress;
+ struct progress *progress = NULL;
struct pack_header *hdr = fill(sizeof(struct pack_header));
unsigned nr_objects = ntohl(hdr->hdr_entries);
struct pack_header *hdr = fill(sizeof(struct pack_header));
unsigned nr_objects = ntohl(hdr->hdr_entries);
die("unknown pack file version %d", ntohl(hdr->hdr_version));
use(sizeof(struct pack_header));
die("unknown pack file version %d", ntohl(hdr->hdr_version));
use(sizeof(struct pack_header));
- if (!quiet) {
- fprintf(stderr, "Unpacking %d objects\n", nr_objects);
- start_progress(&progress, "", nr_objects);
- }
+ if (!quiet)
+ progress = start_progress("Unpacking objects", nr_objects);
obj_list = xmalloc(nr_objects * sizeof(*obj_list));
for (i = 0; i < nr_objects; i++) {
unpack_one(i);
obj_list = xmalloc(nr_objects * sizeof(*obj_list));
for (i = 0; i < nr_objects; i++) {
unpack_one(i);
- if (!quiet)
- display_progress(&progress, i + 1);
+ display_progress(progress, i + 1);
}
}
- if (!quiet)
- stop_progress(&progress);
+ stop_progress(&progress);
if (delta_list)
die("unresolved deltas left after unpacking");
if (delta_list)
die("unresolved deltas left after unpacking");