]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-bitmap: mark object filter as `const`
authorPatrick Steinhardt <ps@pks.im>
Wed, 15 Jul 2026 06:22:32 +0000 (08:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jul 2026 14:19:15 +0000 (07:19 -0700)
The function `for_each_bitmapped_object()` accepts an optional object
filter. This filter is never modified by the function, but is not
declared as `const`. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c
pack-bitmap.h

index 35774b6f0c0da7bc64a0c5d553025effbe4c47af..a47c231632405494465468c3fb908052b5768f10 100644 (file)
@@ -1976,7 +1976,7 @@ static void filter_bitmap_object_type(struct bitmap_index *bitmap_git,
 static int filter_bitmap(struct bitmap_index *bitmap_git,
                         struct object_list *tip_objects,
                         struct bitmap *to_filter,
-                        struct list_objects_filter_options *filter)
+                        const struct list_objects_filter_options *filter)
 {
        if (!filter || filter->choice == LOFC_DISABLED)
                return 0;
@@ -2027,7 +2027,7 @@ static int filter_bitmap(struct bitmap_index *bitmap_git,
        return -1;
 }
 
-static int can_filter_bitmap(struct list_objects_filter_options *filter)
+static int can_filter_bitmap(const struct list_objects_filter_options *filter)
 {
        return !filter_bitmap(NULL, NULL, NULL, filter);
 }
@@ -2058,7 +2058,7 @@ static void filter_packed_objects_from_bitmap(struct bitmap_index *bitmap_git,
 }
 
 int for_each_bitmapped_object(struct bitmap_index *bitmap_git,
-                             struct list_objects_filter_options *filter,
+                             const struct list_objects_filter_options *filter,
                              show_reachable_fn show_reach,
                              void *payload)
 {
index 19a86554579f7c905c876d55f216f05ccc88e833..47935eb24e29ddd145fad36307f8c960d967fe54 100644 (file)
@@ -96,7 +96,7 @@ struct list_objects_filter_options;
  * not supported, `0` otherwise.
  */
 int for_each_bitmapped_object(struct bitmap_index *bitmap_git,
-                             struct list_objects_filter_options *filter,
+                             const struct list_objects_filter_options *filter,
                              show_reachable_fn show_reach,
                              void *payload);