Re: [PATCH v6 6/6] list-objects-filter: implement filter tree:0
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Aug 18, 2018, 16:17 UTC
- Message-ID
- <CACsJy8AE+MwBzzUFRGLKVp6vaAg2W_KO-qbUU2LQpd=rMQw2sA@mail.gmail.com>
- In-Reply-To
- <5d3b4e4acb73009e4cefecd0965fe5dd371efea1.1534374650.git.matvore@google.com>
On Thu, Aug 16, 2018 at 1:54 AM Matthew DeVore <matvore@google.com> wrote:
Show 28 quoted lines
> diff --git a/list-objects-filter.c b/list-objects-filter.c
> index a0ba78b20..8e3caf5bf 100644
> --- a/list-objects-filter.c
> +++ b/list-objects-filter.c
> @@ -80,6 +80,55 @@ static void *filter_blobs_none__init(
> return d;
> }
>
> +/*
> + * A filter for list-objects to omit ALL trees and blobs from the traversal.
> + * Can OPTIONALLY collect a list of the omitted OIDs.
> + */
> +struct filter_trees_none_data {
> + struct oidset *omits;
> +};
> +
> +static enum list_objects_filter_result filter_trees_none(
> + enum list_objects_filter_situation filter_situation,
> + struct object *obj,
> + const char *pathname,
> + const char *filename,
> + void *filter_data_)
> +{
> + struct filter_trees_none_data *filter_data = filter_data_;
> +
> + switch (filter_situation) {
> + default:
> + die("unknown filter_situation");This sounds like BUG() than die() without _(). And you probably want to report filter_situation value too.
> + return LOFR_ZERO;
And neither BUG() or die() returns.
-- Duy