Correct `git-archive --format=3Dzip' command to preserve executable bits in
zip archives.
---
archive-zip.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/archive-zip.c b/archive-zip.c
index 444e162..5f9b7e6 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -191,7 +191,8 @@ static int write_zip_entry(const unsigned char *sha1,
compressed_size =3D 0;
} else if (S_ISREG(mode) || S_ISLNK(mode)) {
method =3D 0;
- attr2 =3D S_ISLNK(mode) ? ((mode | 0777) << 16) : 0;
+ attr2 =3D S_ISLNK(mode) ? ((mode | 0777) << 16) :=20
+ (mode & 0111) ? ((mode) << 16) : 0;
if (S_ISREG(mode) && zlib_compression_level !=3D 0)
method =3D 8;
result =3D 0;
@@ -229,7 +230,8 @@ static int write_zip_entry(const unsigned char *sha1,
}
=20
copy_le32(dirent.magic, 0x02014b50);
- copy_le16(dirent.creator_version, S_ISLNK(mode) ? 0x0317 : 0);
+ copy_le16(dirent.creator_version,
+ S_ISLNK(mode) || (S_ISREG(mode) && (mode & 0111)) ? 0x0317 : 0);
copy_le16(dirent.version, 10);
copy_le16(dirent.flags, 0);
copy_le16(dirent.compression_method, method);
--=20
1.5.3.1| Linus Torvalds | Linux 2.6.27-rc5 |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc8 |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Mark McLoughlin | [PATCH] bridge: make bridge-nf-call-*tables default configurable |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
