summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39345a2)
raw | patch | inline | side by side (parent: 39345a2)
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 9 Sep 2006 15:02:38 +0000 (17:02 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 9 Sep 2006 20:39:57 +0000 (13:39 -0700) |
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
archive.h | patch | blob | history | |
builtin-archive.c | patch | blob | history | |
builtin-zip-tree.c | patch | blob | history |
diff --git a/archive.h b/archive.h
index f3d344b65259fb7f4314944194e12ddba1129a4b..d8cca735d2dcbb13282be85e9e892c318bc53300 100644 (file)
--- a/archive.h
+++ b/archive.h
*/
extern int write_tar_archive(struct archiver_args *);
extern int write_zip_archive(struct archiver_args *);
+extern void *parse_extra_zip_args(int argc, const char **argv);
#endif /* ARCHIVE_H */
diff --git a/builtin-archive.c b/builtin-archive.c
index 651d1bf6d916b40c38be8e0c9000a277fb667349..b94473755061f23f899517c801f809a3bedf7ee9 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
"git-archive --format=<fmt> [--prefix=<prefix>/] [<extra>] <tree-ish> [path...]";
struct archiver archivers[] = {
- { .name = "tar", .write_archive = write_tar_archive },
- { .name = "zip", .write_archive = write_zip_archive },
+ {
+ .name = "tar",
+ .write_archive = write_tar_archive,
+ },
+ {
+ .name = "zip",
+ .write_archive = write_zip_archive,
+ .parse_extra = parse_extra_zip_args,
+ },
};
static int run_remote_archiver(struct archiver *ar, int argc,
diff --git a/builtin-zip-tree.c b/builtin-zip-tree.c
index 3afb7bde743ebd1fbdb80804c2cc995caa160969..4e796338af407929d3004dd0ea756a5b20ad659b 100644 (file)
--- a/builtin-zip-tree.c
+++ b/builtin-zip-tree.c
return 0;
}
+
+void *parse_extra_zip_args(int argc, const char **argv)
+{
+ for (; argc > 0; argc--, argv++) {
+ const char *arg = argv[0];
+
+ if (arg[0] == '-' && isdigit(arg[1]) && arg[2] == '\0')
+ zlib_compression_level = arg[1] - '0';
+ else
+ die("Unknown argument for zip format: %s", arg);
+ }
+ return NULL;
+}