From 965cba2e7ee9b272a35d66a11f0a7bf544aa727a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 2 Jan 2017 17:25:09 -0500 Subject: archive-zip: load userdiff config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: René Scharfe Signed-off-by: Junio C Hamano --- archive-zip.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'archive-zip.c') diff --git a/archive-zip.c b/archive-zip.c index 9db47357b0..b429a8d974 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -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); -- cgit v1.2.3