X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=archive-zip.c;fp=archive-zip.c;h=155ee4a779a1c2cd0cb2a7a8eea8c7ba8ba8502a;hb=acd00ea04998ce469d1775c658134b097e18f5a3;hp=5a62351ab1a46f6a0827a7d41e794c00a4839edc;hpb=35843b1123e2772c5db6d7db5abf279c3253ae57;p=thirdparty%2Fgit.git diff --git a/archive-zip.c b/archive-zip.c index 5a62351ab1..155ee4a779 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -264,9 +264,10 @@ static int has_only_ascii(const char *s) } } -static int entry_is_binary(const char *path, const void *buffer, size_t size) +static int entry_is_binary(struct index_state *istate, const char *path, + const void *buffer, size_t size) { - struct userdiff_driver *driver = userdiff_find_by_path(path); + struct userdiff_driver *driver = userdiff_find_by_path(istate, path); if (!driver) driver = userdiff_find_by_name("default"); if (driver->binary != -1) @@ -352,7 +353,8 @@ static int write_zip_entry(struct archiver_args *args, return error(_("cannot read %s"), oid_to_hex(oid)); crc = crc32(crc, buffer, size); - is_binary = entry_is_binary(path_without_prefix, + is_binary = entry_is_binary(args->repo->index, + path_without_prefix, buffer, size); out = buffer; } @@ -428,7 +430,8 @@ static int write_zip_entry(struct archiver_args *args, break; crc = crc32(crc, buf, readlen); if (is_binary == -1) - is_binary = entry_is_binary(path_without_prefix, + is_binary = entry_is_binary(args->repo->index, + path_without_prefix, buf, readlen); write_or_die(1, buf, readlen); } @@ -460,7 +463,8 @@ static int write_zip_entry(struct archiver_args *args, break; crc = crc32(crc, buf, readlen); if (is_binary == -1) - is_binary = entry_is_binary(path_without_prefix, + is_binary = entry_is_binary(args->repo->index, + path_without_prefix, buf, readlen); zstream.next_in = buf;