Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix symlink handling
author
Linus Torvalds
<torvalds@ppc970.osdl.org>
Thu, 5 May 2005 23:01:46 +0000
(16:01 -0700)
committer
Linus Torvalds
<torvalds@ppc970.osdl.org>
Thu, 5 May 2005 23:01:46 +0000
(16:01 -0700)
We really always want to have S_IFREG there for non-symlinks,
otherwise we create corrupt index files.
cache.h
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
ed4eeaf
)
diff --git
a/cache.h
b/cache.h
index e6ce7312c1f84490e6e3518e9c71047cd2806d05..80f9967053b2c91feeeabf951dd9d1e5fc37a827 100644
(file)
--- 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)