fix 'got send' adding too many objects to the pack file in some cases Load server-side tags before loading local commits. Otherwise objects which are reachable via server-side tags will not be filtered out.
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
diff --git a/lib/pack_create.c b/lib/pack_create.c
index 1455b6d..4ab44ac 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -862,19 +862,6 @@ read_meta(struct got_pack_meta ***meta, int *nmeta,
}
}
- for (i = 0; i < nobj; i++) {
- err = load_commit(&v, idset, ids[i], repo,
- loose_obj_only, cancel_cb, cancel_arg);
- if (err)
- goto done;
- if (progress_cb) {
- err = progress_cb(progress_arg, 0L, nours,
- v.nmeta, 0, 0);
- if (err)
- goto done;
- }
- }
-
for (i = 0; i < ntheirs; i++) {
struct got_object_id *id = theirs[i];
int *cached_type;
@@ -901,6 +888,19 @@ read_meta(struct got_pack_meta ***meta, int *nmeta,
}
}
+ for (i = 0; i < nobj; i++) {
+ err = load_commit(&v, idset, ids[i], repo,
+ loose_obj_only, cancel_cb, cancel_arg);
+ if (err)
+ goto done;
+ if (progress_cb) {
+ err = progress_cb(progress_arg, 0L, nours,
+ v.nmeta, 0, 0);
+ if (err)
+ goto done;
+ }
+ }
+
for (i = 0; i < nours; i++) {
struct got_object_id *id = ours[i];
int *cached_type;