Commit 912a163eb6901d0a797d05fb21b34bc30031eb39

Stefan Sperling 2022-04-10T11:35:53

the obj_types array in pack_create.c is no longer useful, remove it

diff --git a/lib/pack_create.c b/lib/pack_create.c
index 63e8791..f72e0ae 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -839,16 +839,6 @@ search_packidx(int *found, struct got_object_id *id,
 	return err;
 }
 
-static const int obj_types[] = {
-	GOT_OBJ_TYPE_ANY,
-	GOT_OBJ_TYPE_COMMIT,
-	GOT_OBJ_TYPE_TREE,
-	GOT_OBJ_TYPE_BLOB,
-	GOT_OBJ_TYPE_TAG,
-	GOT_OBJ_TYPE_OFFSET_DELTA,
-	GOT_OBJ_TYPE_REF_DELTA
-};
-
 static const struct got_error *
 add_object(int want_meta, struct got_object_idset *idset,
     struct got_object_id *id, const char *path, int obj_type,
@@ -1166,8 +1156,7 @@ drop_commit(struct got_object_idset *keep, struct got_object_idset *drop,
 			continue;
 		}
 
-		err = got_object_idset_add(drop, qid->id,
-		    (void *)&obj_types[GOT_OBJ_TYPE_COMMIT]);
+		err = got_object_idset_add(drop, qid->id, NULL);
 		if (err) {
 			got_object_qid_free(qid);
 			break;
@@ -1336,11 +1325,9 @@ findtwixt(struct got_object_id ***res, int *nres, int *ncolored,
 				goto done;
 			}
 			if (qcolor == COLOR_KEEP)
-				err = got_object_idset_add(keep, id,
-				    (void *)&obj_types[GOT_OBJ_TYPE_COMMIT]);
+				err = got_object_idset_add(keep, id, NULL);
 			else
-				err = got_object_idset_add(drop, id,
-				    (void *)&obj_types[GOT_OBJ_TYPE_COMMIT]);
+				err = got_object_idset_add(drop, id, NULL);
 			if (err) {
 				free(id);
 				goto done;