Thread (128 messages) flat view 128 messages, 6 authors, 2018-10-12

Re: [PATCH v6 6/6] list-objects-filter: implement filter tree:0

From: Duy Nguyen <hidden>
Date: 2018-08-18 16:18:00

On Thu, Aug 16, 2018 at 1:54 AM Matthew DeVore [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help