diff options
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | 2005-05-07 02:57:06 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-06 22:12:08 -0700 |
commit | e7d3dd248f50501f98b29c917e70bddcf3ea925a (patch) | |
tree | ab8e6967a08ac343b69b527f663e6a9722fcea08 /tar-tree.c | |
parent | bf60144c0ab50e88c0086a90c5cb35b81613ad14 (diff) | |
download | git-e7d3dd248f50501f98b29c917e70bddcf3ea925a.tar.gz |
[PATCH] Lift path length limits from git-tar-tree.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'tar-tree.c')
-rw-r--r-- | tar-tree.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tar-tree.c b/tar-tree.c index 9d9bd7be98..8b0d75bd2c 100644 --- a/tar-tree.c +++ b/tar-tree.c @@ -212,7 +212,7 @@ static void write_extended_header(const char *headerfilename, int is_dir, const char *path, unsigned int namelen, void *content, unsigned int contentsize) { - char *p; + char *buffer, *p; unsigned int pathlen, size, linkpathlen = 0; size = pathlen = extended_header_len("path", namelen); @@ -220,18 +220,19 @@ static void write_extended_header(const char *headerfilename, int is_dir, linkpathlen = extended_header_len("linkpath", contentsize); size += linkpathlen; } - if (size > RECORDSIZE) - die("tar-tree: extended header too big, wtf?"); write_header(NULL, TYPEFLAG_EXT_HEADER, NULL, NULL, headerfilename, 0100600, NULL, size); - p = get_record(); + buffer = p = malloc(size); + if (!buffer) + die("git-tar-tree: %s", strerror(errno)); append_extended_header_prefix(&p, pathlen, "path"); append_path(&p, is_dir, basepath, prefix, path); append_char(&p, '\n'); if (flags & EXT_HEADER_LINKPATH) append_extended_header(&p, "linkpath", content, contentsize); - write_if_needed(); + write_blocked(buffer, size); + free(buffer); } static void write_global_extended_header(const char *sha1) @@ -269,9 +270,7 @@ static void write_header(const char *sha1, char typeflag, const char *basepath, } namelen = path_len(S_ISDIR(mode), basepath, prefix, path); - if (namelen > 500) - die("tar-tree: name too log of object %s\n", sha1_to_hex(sha1)); - else if (namelen > 100) + if (namelen > 100) ext_header |= EXT_HEADER_PATH; if (typeflag == TYPEFLAG_LNK && size > 100) ext_header |= EXT_HEADER_LINKPATH; |