path: root/packfile.h
diff options
authorJeff King <>2018-08-14 18:21:18 (GMT)
committerJunio C Hamano <>2018-08-14 19:29:57 (GMT)
commit0889aae1cd18c1804ba01c1a4229e516dfb9fe9b (patch)
tree23d7ffb8ef75b0952294270e041a8a1726016027 /packfile.h
parent79ed0a5e2627a0e1eab0448e6f32d781e80bfafa (diff)
for_each_*_object: move declarations to object-store.h
The for_each_loose_object() and for_each_packed_object() functions are meant to be part of a unified interface: they use the same set of for_each_object_flags, and it's not inconceivable that we might one day add a single for_each_object() wrapper around them. Let's put them together in a single file, so we can avoid awkwardness like saying "the flags for this function are over in cache.h". Moving the loose functions to packfile.h is silly. Moving the packed functions to cache.h works, but makes the "cache.h is a kitchen sink" problem worse. The best place is the recently-created object-store.h, since these are quite obviously related to object storage. The for_each_*_in_objdir() functions do not use the same flags, but they are logically part of the same interface as for_each_loose_object(), and share callback signatures. So we'll move those, as well, as they also make sense in object-store.h. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'packfile.h')
1 files changed, 0 insertions, 20 deletions
diff --git a/packfile.h b/packfile.h
index 99411bd..d91e43f 100644
--- a/packfile.h
+++ b/packfile.h
@@ -149,26 +149,6 @@ extern int has_object_pack(const struct object_id *oid);
extern int has_pack_index(const unsigned char *sha1);
- * Iterate over all accessible packed objects without respect to reachability.
- * By default, this includes both local and alternate packs.
- *
- * Note that some objects may appear twice if they are found in multiple packs.
- * Each pack is visited in an unspecified order. By default, objects within a
- * pack are visited in pack-idx order (i.e., sorted by oid).
- *
- * The list of flags can be found in cache.h.
- */
-typedef int each_packed_object_fn(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
- void *data);
-int for_each_object_in_pack(struct packed_git *p,
- each_packed_object_fn, void *data,
- enum for_each_object_flags flags);
-int for_each_packed_object(each_packed_object_fn, void *,
- enum for_each_object_flags flags);
* Return 1 if an object in a promisor packfile is or refers to the given
* object, 0 otherwise.