From: Linus Torvalds Date: Thu, 5 May 2005 23:01:46 +0000 (-0700) Subject: Fix symlink handling X-Git-Tag: v0.99~638 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=db823d4a5a47d614895c959dce2a379a2364b677;p=git.git Fix symlink handling We really always want to have S_IFREG there for non-symlinks, otherwise we create corrupt index files. --- diff --git a/cache.h b/cache.h index e6ce7312..80f99670 100644 --- a/cache.h +++ b/cache.h @@ -89,11 +89,9 @@ struct cache_entry { #define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644) static inline unsigned int create_ce_mode(unsigned int mode) { - if (S_ISREG(mode)) - return htonl(S_IFREG | ce_permissions(mode)); if (S_ISLNK(mode)) return htonl(S_IFLNK); - return htonl(mode); + return htonl(S_IFREG | ce_permissions(mode)); } #define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)