X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=archive-tar.c;h=56ff356966c002a0d0a86b1b0d88a3ae60718172;hb=af9b54bb2cb0e15780bf3e820b5f1ce399deb2c4;hp=d9c30d33dc286fa2926c80f647304687ba13295b;hpb=2b93bfac0f5bcabbf60f174f4e7bfa9e318e64d5;p=git.git diff --git a/archive-tar.c b/archive-tar.c index d9c30d33d..56ff35696 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -166,7 +166,7 @@ static void write_entry(const unsigned char *sha1, struct strbuf *path, } else { if (verbose) fprintf(stderr, "%.*s\n", path->len, path->buf); - if (S_ISDIR(mode)) { + if (S_ISDIR(mode) || S_ISDIRLNK(mode)) { *header.typeflag = TYPEFLAG_DIR; mode = (mode | 0777) & ~tar_umask; } else if (S_ISLNK(mode)) { @@ -278,7 +278,7 @@ static int write_tar_entry(const unsigned char *sha1, memcpy(path.buf, base, baselen); memcpy(path.buf + baselen, filename, filenamelen); path.len = baselen + filenamelen; - if (S_ISDIR(mode)) { + if (S_ISDIR(mode) || S_ISDIRLNK(mode)) { strbuf_append_string(&path, "/"); buffer = NULL; size = 0;