diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-05-11 18:55:21 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-12 09:35:07 -0700 |
commit | 02851e0b9ed840c2e6881dd56072eefc17c8b98b (patch) | |
tree | a0ccc46ca44cfa4f23f0eaa8c60b00fb991318bb /archive-zip.c | |
parent | 2206537c07973fc2933092313d95340e076440e4 (diff) | |
download | git-02851e0b9ed840c2e6881dd56072eefc17c8b98b.tar.gz |
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-zip.c')
-rw-r--r-- | archive-zip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/archive-zip.c b/archive-zip.c index 7c4984886f..1eaf262b74 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -182,10 +182,10 @@ static int write_zip_entry(const unsigned char *sha1, goto out; } - if (S_ISDIR(mode)) { + if (S_ISDIR(mode) || S_ISDIRLNK(mode)) { method = 0; attr2 = 16; - result = READ_TREE_RECURSIVE; + result = (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0); out = NULL; uncompressed_size = 0; compressed_size = 0; |