Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'list-objects-filter.c')
-rw-r--r--list-objects-filter.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/list-objects-filter.c b/list-objects-filter.c
index 786e0dd0b1..ee449de3f7 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -107,18 +107,19 @@ struct seen_map_entry {
size_t depth;
};
-static void filter_trees_update_omits(
+/* Returns 1 if the oid was in the omits set before it was invoked. */
+static int filter_trees_update_omits(
struct object *obj,
struct filter_trees_depth_data *filter_data,
int include_it)
{
if (!filter_data->omits)
- return;
+ return 0;
if (include_it)
- oidset_remove(filter_data->omits, &obj->oid);
+ return oidset_remove(filter_data->omits, &obj->oid);
else
- oidset_insert(filter_data->omits, &obj->oid);
+ return oidset_insert(filter_data->omits, &obj->oid);
}
static enum list_objects_filter_result filter_trees_depth(
@@ -171,12 +172,17 @@ static enum list_objects_filter_result filter_trees_depth(
if (already_seen) {
filter_res = LOFR_SKIP_TREE;
} else {
+ int been_omitted = filter_trees_update_omits(
+ obj, filter_data, include_it);
seen_info->depth = filter_data->current_depth;
- filter_trees_update_omits(obj, filter_data, include_it);
if (include_it)
filter_res = LOFR_DO_SHOW;
- else if (filter_data->omits)
+ else if (filter_data->omits && !been_omitted)
+ /*
+ * Must update omit information of children
+ * recursively; they have not been omitted yet.
+ */
filter_res = LOFR_ZERO;
else
filter_res = LOFR_SKIP_TREE;