commit 9d34261edbfb3574a41b29233fdc722b526ea226 from: Stefan Sperling date: Thu Apr 07 20:55:39 2022 UTC in load_object_ids(), process "their" commits and tags in the same loop No functional change, the end result is the same. commit - 820e446669735d37c11281ab1f6f6d22f152ad48 commit + 9d34261edbfb3574a41b29233fdc722b526ea226 blob - e852bc8c1a29062aa1e4811140cde57d327d0049 blob + 2367bbad785100530c52f743fc7c907cc20af73f --- lib/pack_create.c +++ lib/pack_create.c @@ -1404,34 +1404,21 @@ load_object_ids(int *ncolored, int *nfound, int *ntree err = got_object_get_type(&obj_type, repo, id); if (err) return err; - if (obj_type != GOT_OBJ_TYPE_COMMIT) - continue; - err = load_commit(0, idset, id, repo, loose_obj_only, - ncolored, nfound, ntrees, progress_cb, progress_arg, rl, - cancel_cb, cancel_arg); - if (err) - goto done; - } - - for (i = 0; i < ntheirs; i++) { - struct got_object_id *id = theirs[i]; - struct got_pack_meta *m; - if (id == NULL) - continue; - m = got_object_idset_get(idset, id); - if (m == NULL) { - err = got_object_get_type(&obj_type, repo, id); + if (obj_type == GOT_OBJ_TYPE_COMMIT) { + err = load_commit(0, idset, id, repo, + loose_obj_only, ncolored, nfound, ntrees, + progress_cb, progress_arg, rl, + cancel_cb, cancel_arg); if (err) goto done; - } else - obj_type = m->obj_type; - if (obj_type != GOT_OBJ_TYPE_TAG) - continue; - err = load_tag(0, idset, id, repo, loose_obj_only, - ncolored, nfound, ntrees, progress_cb, progress_arg, rl, - cancel_cb, cancel_arg); - if (err) - goto done; + } else if (obj_type == GOT_OBJ_TYPE_TAG) { + err = load_tag(0, idset, id, repo, + loose_obj_only, ncolored, nfound, ntrees, + progress_cb, progress_arg, rl, + cancel_cb, cancel_arg); + if (err) + goto done; + } } for (i = 0; i < nobj; i++) {