static int zip_date;
static int zip_time;
static const struct commit *commit;
+static size_t base_len;
static unsigned char *zip_dir;
static unsigned int zip_dir_size;
crc = crc32(0, NULL, 0);
path = construct_path(base, baselen, filename, S_ISDIR(mode), &pathlen);
+ if (is_archive_path_ignored(path + base_len))
+ return 0;
if (verbose)
fprintf(stderr, "%s\n", path);
if (pathlen > 0xffff) {
if (S_ISREG(mode) && zlib_compression_level != 0)
method = 8;
result = 0;
- buffer = sha1_file_to_archive(path, sha1, mode, &type, &size,
- commit);
+ buffer = sha1_file_to_archive(path + base_len, sha1, mode,
+ &type, &size, commit);
if (!buffer)
die("cannot read %s", sha1_to_hex(sha1));
crc = crc32(crc, buffer, size);
zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;
verbose = args->verbose;
commit = args->commit;
+ base_len = args->base ? strlen(args->base) : 0;
if (args->base && plen > 0 && args->base[plen - 1] == '/') {
char *base = xstrdup(args->base);