Re: [PATCH 07/14] odb: introduce `odb_for_each_object()`
Patrick Steinhardt <ps@pks.im> writes:
[snip]
Show 16 quoted lines
> diff --git a/odb.h b/odb.h
> index f97f249580..8f6d95aee5 100644
> --- a/odb.h
> +++ b/odb.h
> @@ -475,6 +475,23 @@ typedef int (*odb_for_each_object_cb)(const struct object_id *oid,
> struct object_info *oi,
> void *cb_data);
>
> +/*
> + * Iterate through all objects contained in the object database. Note that
> + * objects may be iterated over multiple times in case they are either stored
> + * in different backends or in case they are stored in multiple sources.
> + *
> + * Returning a non-zero error code will cause iteration to abort. The error
> + * code will be propagated.
> + *
Super-Nit: This is for the callback function. It would be nice to be
explicit about that.
Show 15 quoted lines
> + * Returns 0 on success, a negative error code in case a failure occurred, or
> + * an arbitrary non-zero error code returned by the callback itself.
> + */
> +int odb_for_each_object(struct object_database *odb,
> + struct object_info *oi,
> + odb_for_each_object_cb cb,
> + void *cb_data,
> + unsigned flags);
> +
> enum {
> /*
> * By default, `odb_write_object()` does not actually write anything
>
> --
> 2.52.0.660.gd05f3a8ea5.dirty