commit - 91554d234c633881db3ad62e68994adab1d3a9eb
commit + f116c762e79e9065488f51830469be38df406011
blob - 8d07805c20549afd334e001151748c6ec86fd1f1
blob + e05050ac3116887d11669d86005100748e10b21a
--- lib/repository_admin.c
+++ lib/repository_admin.c
static const struct got_error *
report_cleanup_progress(got_cleanup_progress_cb progress_cb,
void *progress_arg, struct got_ratelimit *rl,
- int nloose, int ncommits, int npurged)
+ int nloose, int ncommits, int npurged, int nredundant)
{
const struct got_error *err;
int elapsed;
if (err || !elapsed)
return err;
- return progress_cb(progress_arg, nloose, ncommits, npurged, -1);
+ return progress_cb(progress_arg, nloose, ncommits, npurged, nredundant);
}
static const struct got_error *
goto done;
err = report_cleanup_progress(progress_cb,
progress_arg, rl,
- got_object_idset_num_elements(*loose_ids), -1, -1);
+ got_object_idset_num_elements(*loose_ids),
+ -1, -1, -1);
if (err)
goto done;
}
(*ncommits)++; /* scanned tags are counted as commits */
err = report_cleanup_progress(progress_cb, progress_arg, rl,
- nloose, *ncommits, -1);
+ nloose, *ncommits, -1, -1);
if (err)
break;
a->npurged++;
a->size_purged += sb.st_size;
err = report_cleanup_progress(a->progress_cb, a->progress_arg,
- a->rl, a->nloose, a->ncommits, a->npurged);
+ a->rl, a->nloose, a->ncommits, a->npurged, -1);
if (err)
goto done;
}
struct got_pathlist_entry *pe;
size_t i, npacks;
int remove, redundant_packs = 0;
+ struct got_ratelimit rl;
+
+ got_ratelimit_init(&rl, 0, 500);
*size_before = 0;
*size_after = 0;
goto done;
if (!remove)
continue;
- if (progress_cb) {
- err = progress_cb(progress_arg, nloose, ncommits,
- npurged, ++redundant_packs);
- if (err)
- goto done;
- }
+ err = report_cleanup_progress(progress_cb, progress_arg,
+ &rl, nloose, ncommits, npurged, ++redundant_packs);
+ if (err)
+ goto done;
}
/* Produce a final progress report. */