pack-bitmap: stop truncating blob sizes used by --filter=blob:limit

Same theme as the preceding pack-objects series: get_size_by_pos()
returns an unsigned long but reads its size out of packed_object_info()
/ odb_read_object_info_extended() via a size_t out-parameter, so on
Windows it would silently truncate the very sizes filter_bitmap_blob_limit()
then compares against the --filter=blob:limit threshold to decide which
blobs to elide from the bitmap-backed traversal. Drop the
cast_size_t_to_ulong() and return size_t directly.

The two callers' limit comparison promotes to size_t cleanly. limit
itself stays unsigned long; it is part of a filter API ripple of its
own.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2026-06-05 15:00:18 +02:00
committed by Git for Windows Build Agent
parent 6ad817c465
commit fca28ca71a

View File

@@ -1853,8 +1853,8 @@ static void filter_bitmap_blob_none(struct bitmap_index *bitmap_git,
OBJ_BLOB);
}
static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
uint32_t pos)
static size_t get_size_by_pos(struct bitmap_index *bitmap_git,
uint32_t pos)
{
size_t size;
struct object_info oi = OBJECT_INFO_INIT;
@@ -1891,7 +1891,7 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
die(_("unable to get size of %s"), oid_to_hex(&obj->oid));
}
return cast_size_t_to_ulong(size);
return size;
}
static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,