summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 23:01:46 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 23:01:46 (GMT)
commitdb823d4a5a47d614895c959dce2a379a2364b677 (patch)
tree67b44bb0ddfcf9e69b5dbafd0a5223ea55dffda9
parented4eeaf203d0f293bd5ffc2a0ad8711f052db1f3 (diff)
downloadgit-db823d4a5a47d614895c959dce2a379a2364b677.zip
git-db823d4a5a47d614895c959dce2a379a2364b677.tar.gz
git-db823d4a5a47d614895c959dce2a379a2364b677.tar.bz2
Fix symlink handling
We really always want to have S_IFREG there for non-symlinks, otherwise we create corrupt index files.
-rw-r--r--cache.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/cache.h b/cache.h
index e6ce731..80f9967 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)