summaryrefslogtreecommitdiff
path: root/archive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-06-22 01:24:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-06-22 18:12:35 (GMT)
commit4d7c98986379b0ab93cbf9092b60dfb5ab1cee7c (patch)
treebfee1193f7a5bcfb17829faf5c419bfd2a654bb4 /archive.c
parent13e0f88d4aba326da9217c225d6ab5e642eb611d (diff)
downloadgit-4d7c98986379b0ab93cbf9092b60dfb5ab1cee7c.zip
git-4d7c98986379b0ab93cbf9092b60dfb5ab1cee7c.tar.gz
git-4d7c98986379b0ab93cbf9092b60dfb5ab1cee7c.tar.bz2
archive: pass archiver struct to write_archive callback
The current archivers are very static; when you are in the write_tar_archive function, you know you are writing a tar. However, to facilitate runtime-configurable archivers that will share a common write function we need to tell the function which archiver was used. As a convenience, we also provide an opaque data pointer in the archiver struct so that individual archivers can put something useful there when they register themselves. Technically they could just use the "name" field to look in an internal map of names to data, but this is much simpler. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.c')
-rw-r--r--archive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/archive.c b/archive.c
index f0b4e85..a0a5beb 100644
--- a/archive.c
+++ b/archive.c
@@ -410,5 +410,5 @@ int write_archive(int argc, const char **argv, const char *prefix,
parse_treeish_arg(argv, &args, prefix);
parse_pathspec_arg(argv + 1, &args);
- return ar->write_archive(&args);
+ return ar->write_archive(ar, &args);
}