fix pack.sh test failure from reuse-deltas patch by tweaking progress output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
diff --git a/lib/pack_create.c b/lib/pack_create.c
index 126be35..36b6b12 100644
--- a/lib/pack_create.c
+++ b/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,17 +1409,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;
- }
-
- 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++) {
@@ -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;