Skip to content

Commit

Permalink
Fix symlink handling
Browse files Browse the repository at this point in the history
We really always want to have S_IFREG there for non-symlinks,
otherwise we create corrupt index files.
  • Loading branch information
Linus Torvalds committed May 5, 2005
1 parent ed4eeaf commit db823d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit db823d4

Please sign in to comment.