Commit Diff


commit - a378df9ff9b56b9f071344e40911642c97beb051
commit + 8eef427678ef08e2fe74a9a4c98f0a1190df5d73
blob - d2ad520451a26816928ff1b63ae309b790b46595
blob + 54d0f119439642b1a7ad27011f857eb86ca313b4
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -1403,34 +1403,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++) {