archive-zip: load userdiff config

Since 4aff646d17 (archive-zip: mark text files in archives,
2015-03-05), the zip archiver will look at the userdiff
driver to decide whether a file is text or binary. This
usually doesn't need to look any further than the attributes
themselves (e.g., "-diff", etc). But if the user defines a
custom driver like "diff=foo", we need to look at
"diff.foo.binary" in the config. Prior to this patch, we
didn't actually load it.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2017-01-02 17:25:09 -05:00
committed by Junio C Hamano
parent c3808ca698
commit 965cba2e7e
2 changed files with 25 additions and 4 deletions

View File

@@ -554,11 +554,18 @@ static void dos_time(time_t *time, int *dos_date, int *dos_time)
*dos_time = t->tm_sec / 2 + t->tm_min * 32 + t->tm_hour * 2048;
}
static int archive_zip_config(const char *var, const char *value, void *data)
{
return userdiff_config(var, value);
}
static int write_zip_archive(const struct archiver *ar,
struct archiver_args *args)
{
int err;
git_config(archive_zip_config, NULL);
dos_time(&args->time, &zip_date, &zip_time);
zip_dir = xmalloc(ZIP_DIRECTORY_MIN_SIZE);