summaryrefslogtreecommitdiff
path: root/archive-zip.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-01-02 22:25:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-08 02:49:30 (GMT)
commit965cba2e7ee9b272a35d66a11f0a7bf544aa727a (patch)
treea04e9feb44586fee85bff420c7d370bf491cfdaf /archive-zip.c
parentc3808ca6982b0ad7ee9b87eca9b50b9a24ec08b0 (diff)
downloadgit-965cba2e7ee9b272a35d66a11f0a7bf544aa727a.zip
git-965cba2e7ee9b272a35d66a11f0a7bf544aa727a.tar.gz
git-965cba2e7ee9b272a35d66a11f0a7bf544aa727a.tar.bz2
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>
Diffstat (limited to 'archive-zip.c')
-rw-r--r--archive-zip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/archive-zip.c b/archive-zip.c
index 9db4735..b429a8d 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);