summaryrefslogtreecommitdiff
path: root/archive-tar.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-05-11 16:55:21 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-05-12 16:35:07 (GMT)
commit02851e0b9ed840c2e6881dd56072eefc17c8b98b (patch)
treea0ccc46ca44cfa4f23f0eaa8c60b00fb991318bb /archive-tar.c
parent2206537c07973fc2933092313d95340e076440e4 (diff)
downloadgit-02851e0b9ed840c2e6881dd56072eefc17c8b98b.zip
git-02851e0b9ed840c2e6881dd56072eefc17c8b98b.tar.gz
git-02851e0b9ed840c2e6881dd56072eefc17c8b98b.tar.bz2
git-archive: don't die when repository uses subprojects
Both archive-tar and archive-zip needed to be taught about subprojects. The tar function died when trying to read the subproject commit object, while the zip function reported "unsupported file mode". This fixes both by representing the subproject as an empty directory. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archive-tar.c b/archive-tar.c
index d9c30d3..56ff356 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;