diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-04-10 00:29:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-04-10 00:29:33 -0700 |
commit | 179c94b24ae87e28328f9b311489417b66bd62c9 (patch) | |
tree | 3458de6031a61992cf96700826c29096867cae43 /archive-zip.c | |
parent | 1d2375ddfee18bd3effd2c1f98527cc2f8b1df0a (diff) | |
parent | abea85d1e9ee0bd77e41e934534aa5d5cdd0593a (diff) | |
download | git-179c94b24ae87e28328f9b311489417b66bd62c9.tar.gz |
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
core-tutorial.txt: Fix showing the current behaviour.
git-archive: ignore prefix when checking file attribute
Fix documentation syntax of optional arguments in short options.
Diffstat (limited to 'archive-zip.c')
-rw-r--r-- | archive-zip.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/archive-zip.c b/archive-zip.c index 74e30f6205..18c0f8710c 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -13,6 +13,7 @@ static int verbose; 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; @@ -197,8 +198,8 @@ static int write_zip_entry(const unsigned char *sha1, 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); @@ -321,6 +322,7 @@ int write_zip_archive(struct archiver_args *args) 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); |