diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2008-07-14 21:22:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-15 07:17:59 -0700 |
commit | 671f0707212c929533dc6ec9e032faee328e4602 (patch) | |
tree | dbee94a8ff126713d0bb3f72321392e38a66c55e /archive-zip.c | |
parent | 34533004b27df4f34e18d9e26832fcc956a39fca (diff) | |
download | git-671f0707212c929533dc6ec9e032faee328e4602.tar.gz |
add context pointer to read_tree_recursive()
Add a pointer parameter to read_tree_recursive(), which is passed to the
callback function. This allows callers of read_tree_recursive() to
share data with the callback without resorting to global variables. All
current callers pass NULL.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-zip.c')
-rw-r--r-- | archive-zip.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archive-zip.c b/archive-zip.c index 5742762ac3..0d24f3fe37 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -152,9 +152,9 @@ static char *construct_path(const char *base, int baselen, return path; } -static int write_zip_entry(const unsigned char *sha1, - const char *base, int baselen, - const char *filename, unsigned mode, int stage) +static int write_zip_entry(const unsigned char *sha1, const char *base, + int baselen, const char *filename, unsigned mode, int stage, + void *context) { struct zip_local_header header; struct zip_dir_header dirent; @@ -332,11 +332,12 @@ int write_zip_archive(struct archiver_args *args) while (baselen > 0 && base[baselen - 1] == '/') base[--baselen] = '\0'; - write_zip_entry(args->tree->object.sha1, "", 0, base, 040777, 0); + write_zip_entry(args->tree->object.sha1, "", 0, base, 040777, + 0, NULL); free(base); } read_tree_recursive(args->tree, args->base, plen, 0, - args->pathspec, write_zip_entry); + args->pathspec, write_zip_entry, NULL); write_zip_trailer(args->commit_sha1); free(zip_dir); |