pack-bitmap: mark object filter as `const`

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>

Patrick Steinhardt committed Jul 15, 2026 at 08:22 UTC 03aaa4f8985ce4813033c1afa36ebec7d7e2a9a1
2 files changed +4 -4
pack-bitmap.c
+3 -3
@@ -1976,7 +1976,7 @@ static void filter_bitmap_object_type(struct bitmap_index *bitmap_git,
1976 static int filter_bitmap(struct bitmap_index *bitmap_git,
1977 struct object_list *tip_objects,
1978 struct bitmap *to_filter,
1979 - struct list_objects_filter_options *filter)
1979 + const struct list_objects_filter_options *filter)
1980 {
1981 if (!filter || filter->choice == LOFC_DISABLED)
1982 return 0;
@@ -2027,7 +2027,7 @@ static int filter_bitmap(struct bitmap_index *bitmap_git,
2027 return -1;
2028 }
2029
2030 -static int can_filter_bitmap(struct list_objects_filter_options *filter)
2030 +static int can_filter_bitmap(const struct list_objects_filter_options *filter)
2031 {
2032 return !filter_bitmap(NULL, NULL, NULL, filter);
2033 }
@@ -2058,7 +2058,7 @@ static void filter_packed_objects_from_bitmap(struct bitmap_index *bitmap_git,
2058 }
2059
2060 int for_each_bitmapped_object(struct bitmap_index *bitmap_git,
2061 - struct list_objects_filter_options *filter,
2061 + const struct list_objects_filter_options *filter,
2062 show_reachable_fn show_reach,
2063 void *payload)
2064 {
pack-bitmap.h
+1 -1
@@ -96,7 +96,7 @@ struct list_objects_filter_options;
96 * not supported, `0` otherwise.
97 */
98 int for_each_bitmapped_object(struct bitmap_index *bitmap_git,
99 - struct list_objects_filter_options *filter,
99 + const struct list_objects_filter_options *filter,
100 show_reachable_fn show_reach,
101 void *payload);
102