Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-14 19:34:12 +0400
committerJunio C Hamano <gitster@pobox.com>2013-01-14 19:34:12 +0400
commitf0c103b49cc5957de5c332d0ca9915fdb96a26cf (patch)
tree3c5bf30ec91a547d29f3d940d95b779f31a6e250 /archive-tar.c
parent32e820bdc5ca66d53605bfdcb0751b21a2372de2 (diff)
parent22f0dcd9634a818a0c83f23ea1a48f2d620c0546 (diff)
Merge branch 'rs/leave-base-name-in-name-field-of-tar' into maint
A tar archive created by "git archive" recorded a directory in a way that made NetBSD's implementation of "tar" sometimes unhappy. * rs/leave-base-name-in-name-field-of-tar: archive-tar: split long paths more carefully
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 0ba3f25cf5..d1cce46e33 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -153,6 +153,8 @@ static unsigned int ustar_header_chksum(const struct ustar_header *header)
static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
{
size_t i = pathlen;
+ if (i > 1 && path[i - 1] == '/')
+ i--;
if (i > maxlen)
i = maxlen;
do {