mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-27 00:58:30 -05:00
fast-export: drop the export_blob() size cast and widen anonymize_blob()
Mirror of the preceding fast-import sweep. anonymize_blob() writes strbuf.len (size_t) into its out-parameter, and export_blob()'s non-anonymize branch reads odb_read_object()'s size_t out-parameter through a size_st + cast_size_t_to_ulong() bridge into an unsigned long local; both have been silent on Windows past 4 GiB. Widen the helper signature and the local, and drop the bridge. check_object_signature() and parse_object_buffer() still take unsigned long, so the silent narrowing on Windows just moves from the local assignment to those call sites; both are separate topics. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
committed by
Git for Windows Build Agent
parent
68eaa6e75b
commit
bd956e9dd4
@@ -285,7 +285,7 @@ static void show_progress(void)
|
||||
* There's no need to cache this result with anonymize_mem, since
|
||||
* we already handle blob content caching with marks.
|
||||
*/
|
||||
static char *anonymize_blob(unsigned long *size)
|
||||
static char *anonymize_blob(size_t *size)
|
||||
{
|
||||
static int counter;
|
||||
struct strbuf out = STRBUF_INIT;
|
||||
@@ -296,7 +296,7 @@ static char *anonymize_blob(unsigned long *size)
|
||||
|
||||
static void export_blob(const struct object_id *oid)
|
||||
{
|
||||
unsigned long size;
|
||||
size_t size;
|
||||
enum object_type type;
|
||||
char *buf;
|
||||
struct object *object;
|
||||
@@ -317,10 +317,8 @@ static void export_blob(const struct object_id *oid)
|
||||
object = (struct object *)lookup_blob(the_repository, oid);
|
||||
eaten = 0;
|
||||
} else {
|
||||
size_t size_st = 0;
|
||||
buf = odb_read_object(the_repository->objects, oid, &type,
|
||||
&size_st);
|
||||
size = cast_size_t_to_ulong(size_st);
|
||||
&size);
|
||||
if (!buf)
|
||||
die(_("could not read blob %s"), oid_to_hex(oid));
|
||||
if (check_object_signature(the_repository, oid, buf, size,
|
||||
|
||||
Reference in New Issue
Block a user