commit f9a643e8b740363d5cf068472042b500426fa0b2 from: Stefan Sperling via: Thomas Adam date: Sun Feb 13 00:43:46 2022 UTC fix pack.sh test failure from reuse-deltas patch by tweaking progress output commit - f9c2e8e5d5310b6b1cd22dcfc8f9f5d1d7a16d19 commit + f9a643e8b740363d5cf068472042b500426fa0b2 blob - 02cc899d584540f6f7145e174487276abd846cea blob + 138499bf96babfa8fcd49411e9ae49826a51ae96 --- lib/pack_create.c +++ lib/pack_create.c @@ -1338,8 +1338,7 @@ static const struct got_error * load_object_ids(struct got_object_idset *idset, struct got_object_id **theirs, int ntheirs, struct got_object_id **ours, int nours, struct got_repository *repo, - int loose_obj_only, got_pack_progress_cb progress_cb, void *progress_arg, - struct got_ratelimit *rl, got_cancel_cb cancel_cb, void *cancel_arg) + int loose_obj_only, got_cancel_cb cancel_cb, void *cancel_arg) { const struct got_error *err = NULL; struct got_object_id **ids = NULL; @@ -1363,11 +1362,6 @@ load_object_ids(struct got_object_idset *idset, loose_obj_only, cancel_cb, cancel_arg); if (err) goto done; - err = report_progress(progress_cb, progress_arg, rl, - 0L, nours, got_object_idset_num_elements(idset), - 0, 0); - if (err) - goto done; } for (i = 0; i < ntheirs; i++) { @@ -1388,10 +1382,6 @@ load_object_ids(struct got_object_idset *idset, loose_obj_only, cancel_cb, cancel_arg); if (err) goto done; - err = report_progress(progress_cb, progress_arg, rl, - 0L, nours, got_object_idset_num_elements(idset), 0, 0); - if (err) - goto done; } for (i = 0; i < nobj; i++) { @@ -1399,12 +1389,6 @@ load_object_ids(struct got_object_idset *idset, loose_obj_only, cancel_cb, cancel_arg); if (err) goto done; - if (err) - goto done; - err = report_progress(progress_cb, progress_arg, rl, - 0L, nours, got_object_idset_num_elements(idset), 0, 0); - if (err) - goto done; } for (i = 0; i < nours; i++) { @@ -1425,18 +1409,7 @@ load_object_ids(struct got_object_idset *idset, loose_obj_only, cancel_cb, cancel_arg); if (err) goto done; - err = report_progress(progress_cb, progress_arg, rl, - 0L, nours, got_object_idset_num_elements(idset), 0, 0); - if (err) - goto done; } - - if (progress_cb) { - err = progress_cb(progress_arg, 0L, nours, - got_object_idset_num_elements(idset), 0, 0); - if (err) - goto done; - } done: for (i = 0; i < nobj; i++) { free(ids[i]); @@ -1795,8 +1768,7 @@ got_pack_create(uint8_t *packsha1, FILE *packfile, return got_error_from_errno("got_object_idset_alloc"); err = load_object_ids(idset, theirs, ntheirs, ours, nours, - repo, loose_obj_only, progress_cb, progress_arg, &rl, - cancel_cb, cancel_arg); + repo, loose_obj_only, cancel_cb, cancel_arg); if (err) return err; @@ -1805,6 +1777,13 @@ got_pack_create(uint8_t *packsha1, FILE *packfile, if (err) goto done; + if (progress_cb) { + err = progress_cb(progress_arg, 0L, nours, + got_object_idset_num_elements(idset), 0, 0); + if (err) + goto done; + } + if (got_object_idset_num_elements(idset) == 0 && !allow_empty) { err = got_error(GOT_ERR_CANNOT_PACK); goto done;