Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Revert "archive-zip: support UTF-8 paths"
author
Junio C Hamano
<gitster@pobox.com>
Tue, 18 Sep 2012 20:32:39 +0000
(13:32 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 18 Sep 2012 20:32:39 +0000
(13:32 -0700)
This reverts commit
2162bd8cc461d6c3a12ab81c5db5a44bf5ecabc3
; a
two-patch series to replace it will follow.
archive-zip.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2162bd8
)
diff --git
a/archive-zip.c
b/archive-zip.c
index 928da1d79108ba783ec2afba2b8c6f8d5653f19b..f5af81f904df081002dad46a71be2eca8e3bebab 100644
(file)
--- a/
archive-zip.c
+++ b/
archive-zip.c
@@
-4,8
+4,6
@@
#include "cache.h"
#include "archive.h"
#include "streaming.h"
#include "cache.h"
#include "archive.h"
#include "streaming.h"
-#include "commit.h"
-#include "utf8.h"
static int zip_date;
static int zip_time;
static int zip_date;
static int zip_time;
@@
-18,8
+16,7
@@
static unsigned int zip_dir_offset;
static unsigned int zip_dir_entries;
#define ZIP_DIRECTORY_MIN_SIZE (1024 * 1024)
static unsigned int zip_dir_entries;
#define ZIP_DIRECTORY_MIN_SIZE (1024 * 1024)
-#define ZIP_STREAM (1 << 3)
-#define ZIP_UTF8 (1 << 11)
+#define ZIP_STREAM (8)
struct zip_local_header {
unsigned char magic[4];
struct zip_local_header {
unsigned char magic[4];
@@
-176,8
+173,7
@@
static int write_zip_entry(struct archiver_args *args,
{
struct zip_local_header header;
struct zip_dir_header dirent;
{
struct zip_local_header header;
struct zip_dir_header dirent;
- unsigned int creator_version = 0;
- unsigned long attr2 = 0;
+ unsigned long attr2;
unsigned long compressed_size;
unsigned long crc;
unsigned long direntsize;
unsigned long compressed_size;
unsigned long crc;
unsigned long direntsize;
@@
-191,13
+187,6
@@
static int write_zip_entry(struct archiver_args *args,
crc = crc32(0, NULL, 0);
crc = crc32(0, NULL, 0);
- if (has_non_ascii(path)) {
- if (is_utf8(path))
- flags |= ZIP_UTF8;
- else
- warning("Path is not valid UTF-8: %s", path);
- }
-
if (pathlen > 0xffff) {
return error("path too long (%d chars, SHA1: %s): %s",
(int)pathlen, sha1_to_hex(sha1), path);
if (pathlen > 0xffff) {
return error("path too long (%d chars, SHA1: %s): %s",
(int)pathlen, sha1_to_hex(sha1), path);
@@
-215,15
+204,10
@@
static int write_zip_entry(struct archiver_args *args,
enum object_type type = sha1_object_info(sha1, &size);
method = 0;
enum object_type type = sha1_object_info(sha1, &size);
method = 0;
+ attr2 = S_ISLNK(mode) ? ((mode | 0777) << 16) :
+ (mode & 0111) ? ((mode) << 16) : 0;
if (S_ISREG(mode) && args->compression_level != 0 && size > 0)
method = 8;
if (S_ISREG(mode) && args->compression_level != 0 && size > 0)
method = 8;
- if (S_ISLNK(mode) || (mode & 0111) || (flags & ZIP_UTF8)) {
- creator_version = 0x033f;
- attr2 = mode;
- if (S_ISLNK(mode))
- attr2 |= 0777;
- attr2 <<= 16;
- }
compressed_size = size;
if (S_ISREG(mode) && type == OBJ_BLOB && !args->convert &&
compressed_size = size;
if (S_ISREG(mode) && type == OBJ_BLOB && !args->convert &&
@@
-270,7
+254,8
@@
static int write_zip_entry(struct archiver_args *args,
}
copy_le32(dirent.magic, 0x02014b50);
}
copy_le32(dirent.magic, 0x02014b50);
- copy_le16(dirent.creator_version, creator_version);
+ copy_le16(dirent.creator_version,
+ S_ISLNK(mode) || (S_ISREG(mode) && (mode & 0111)) ? 0x0317 : 0);
copy_le16(dirent.version, 10);
copy_le16(dirent.flags, flags);
copy_le16(dirent.compression_method, method);
copy_le16(dirent.version, 10);
copy_le16(dirent.flags, flags);
copy_le16(dirent.compression_method, method);