diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:48:00 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:48:00 -0800 |
| commit | 703c97519dfac64291f79b1772e25c65d233e97e (patch) | |
| tree | eaa54faaa2f776393ba94dd35ef37cded5649f62 /object-file.h | |
| parent | 7c02d39fc2ed2702223c7674f73150d9a7e61ba4 (diff) | |
| parent | 3565faf28c2059c6260d53ac71a303b1c04b0a7b (diff) | |
| download | git-703c97519dfac64291f79b1772e25c65d233e97e.tar.xz | |
Merge branch 'ps/odb-for-each-object' into ps/odb-sources
* ps/odb-for-each-object:
odb: drop unused `for_each_{loose,packed}_object()` functions
reachable: convert to use `odb_for_each_object()`
builtin/pack-objects: use `packfile_store_for_each_object()`
odb: introduce mtime fields for object info requests
treewide: drop uses of `for_each_{loose,packed}_object()`
treewide: enumerate promisor objects via `odb_for_each_object()`
builtin/fsck: refactor to use `odb_for_each_object()`
odb: introduce `odb_for_each_object()`
packfile: introduce function to iterate through objects
packfile: extract function to iterate through objects of a store
object-file: introduce function to iterate through objects
object-file: extract function to read object info from path
odb: fix flags parameter to be unsigned
odb: rename `FOR_EACH_OBJECT_*` flags
Diffstat (limited to 'object-file.h')
| -rw-r--r-- | object-file.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/object-file.h b/object-file.h index a62d0de394..8df10bbb15 100644 --- a/object-file.h +++ b/object-file.h @@ -47,7 +47,8 @@ void odb_source_loose_reprepare(struct odb_source *source); int odb_source_loose_read_object_info(struct odb_source *source, const struct object_id *oid, - struct object_info *oi, int flags); + struct object_info *oi, + unsigned flags); int odb_source_loose_read_object_stream(struct odb_read_stream **out, struct odb_source *source, @@ -126,16 +127,17 @@ int for_each_loose_file_in_source(struct odb_source *source, void *data); /* - * Iterate over all accessible loose objects without respect to - * reachability. By default, this includes both local and alternate objects. - * The order in which objects are visited is unspecified. - * - * Any flags specific to packs are ignored. + * Iterate through all loose objects in the given object database source and + * invoke the callback function for each of them. If an object info request is + * given, then the object info will be read for every individual object and + * passed to the callback as if `odb_source_loose_read_object_info()` was + * called for the object. */ -int for_each_loose_object(struct object_database *odb, - each_loose_object_fn, void *, - enum for_each_object_flags flags); - +int odb_source_loose_for_each_object(struct odb_source *source, + const struct object_info *request, + odb_for_each_object_cb cb, + void *cb_data, + unsigned flags); /** * format_object_header() is a thin wrapper around s xsnprintf() that |
