commit - 900499fd0de2c868694828487244f097de63289e
commit + 5852c834af2b4ead86c14a9e8a7f242183b7244b
blob - 6fa4671fb9daa18d8e83c5e0144be2fd6b847e90
blob + 31425fb8310125b7f7fe7389432f6a005df42136
--- 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. */