rebase-interactive.c: remove the_repository references
[gitweb.git] / list-objects-filter.c
index 09b2b05d5462318353aee9133e36bd5924cfa409..a62624a1ced704156395b3e30312f264aa46b862 100644 (file)
@@ -34,6 +34,7 @@ struct filter_blobs_none_data {
 };
 
 static enum list_objects_filter_result filter_blobs_none(
+       struct repository *r,
        enum list_objects_filter_situation filter_situation,
        struct object *obj,
        const char *pathname,
@@ -88,6 +89,7 @@ struct filter_trees_none_data {
 };
 
 static enum list_objects_filter_result filter_trees_none(
+       struct repository *r,
        enum list_objects_filter_situation filter_situation,
        struct object *obj,
        const char *pathname,
@@ -102,9 +104,16 @@ static enum list_objects_filter_result filter_trees_none(
 
        case LOFS_BEGIN_TREE:
        case LOFS_BLOB:
-               if (filter_data->omits)
+               if (filter_data->omits) {
                        oidset_insert(filter_data->omits, &obj->oid);
-               return LOFR_MARK_SEEN; /* but not LOFR_DO_SHOW (hard omit) */
+                       /* _MARK_SEEN but not _DO_SHOW (hard omit) */
+                       return LOFR_MARK_SEEN;
+               } else {
+                       /*
+                        * Not collecting omits so no need to to traverse tree.
+                        */
+                       return LOFR_SKIP_TREE | LOFR_MARK_SEEN;
+               }
 
        case LOFS_END_TREE:
                assert(obj->type == OBJ_TREE);
@@ -137,6 +146,7 @@ struct filter_blobs_limit_data {
 };
 
 static enum list_objects_filter_result filter_blobs_limit(
+       struct repository *r,
        enum list_objects_filter_situation filter_situation,
        struct object *obj,
        const char *pathname,
@@ -164,7 +174,7 @@ static enum list_objects_filter_result filter_blobs_limit(
                assert(obj->type == OBJ_BLOB);
                assert((obj->flags & SEEN) == 0);
 
-               t = oid_object_info(the_repository, &obj->oid, &object_length);
+               t = oid_object_info(r, &obj->oid, &object_length);
                if (t != OBJ_BLOB) { /* probably OBJ_NONE */
                        /*
                         * We DO NOT have the blob locally, so we cannot
@@ -242,6 +252,7 @@ struct filter_sparse_data {
 };
 
 static enum list_objects_filter_result filter_sparse(
+       struct repository *r,
        enum list_objects_filter_situation filter_situation,
        struct object *obj,
        const char *pathname,
@@ -261,7 +272,7 @@ static enum list_objects_filter_result filter_sparse(
                dtype = DT_DIR;
                val = is_excluded_from_list(pathname, strlen(pathname),
                                            filename, &dtype, &filter_data->el,
-                                           &the_index);
+                                           r->index);
                if (val < 0)
                        val = filter_data->array_frame[filter_data->nr].defval;
 
@@ -324,7 +335,7 @@ static enum list_objects_filter_result filter_sparse(
                dtype = DT_REG;
                val = is_excluded_from_list(pathname, strlen(pathname),
                                            filename, &dtype, &filter_data->el,
-                                           &the_index);
+                                           r->index);
                if (val < 0)
                        val = frame->defval;
                if (val > 0) {