the obj_types array in pack_create.c is no longer useful, remove it
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
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;