summaryrefslogtreecommitdiff
path: root/builtin-zip-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-10 05:42:02 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-09-10 20:39:25 (GMT)
commite0ffb24877d4530208905512f7c91dd8d71e2c95 (patch)
treedf9d8046b159c0b2418e2a04c9eacb007517a936 /builtin-zip-tree.c
parent8142f603b9955648228549d2e83ace7fbe834114 (diff)
downloadgit-e0ffb24877d4530208905512f7c91dd8d71e2c95.zip
git-e0ffb24877d4530208905512f7c91dd8d71e2c95.tar.gz
git-e0ffb24877d4530208905512f7c91dd8d71e2c95.tar.bz2
Add --verbose to git-archive
And teach backends about it. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 9e2c44a2893ae90944a0b7c9f40a9d22b759b5c0 commit)
Diffstat (limited to 'builtin-zip-tree.c')
-rw-r--r--builtin-zip-tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-zip-tree.c b/builtin-zip-tree.c
index fdac2bd..52d4b7a 100644
--- a/builtin-zip-tree.c
+++ b/builtin-zip-tree.c
@@ -13,6 +13,7 @@
static const char zip_tree_usage[] =
"git-zip-tree [-0|...|-9] <tree-ish> [ <base> ]";
+static int verbose;
static int zip_date;
static int zip_time;
@@ -164,6 +165,8 @@ static int write_zip_entry(const unsigned char *sha1,
crc = crc32(0, Z_NULL, 0);
path = construct_path(base, baselen, filename, S_ISDIR(mode), &pathlen);
+ if (verbose)
+ fprintf(stderr, "%s\n", path);
if (pathlen > 0xffff) {
error("path too long (%d chars, SHA1: %s): %s", pathlen,
sha1_to_hex(sha1), path);
@@ -361,6 +364,7 @@ int write_zip_archive(struct archiver_args *args)
zip_dir = xmalloc(ZIP_DIRECTORY_MIN_SIZE);
zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;
+ verbose = args->verbose;
if (args->base && plen > 0 && args->base[plen - 1] == '/') {
char *base = xstrdup(args->base);