aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 22:26:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 22:26:31 -0700
commite44794706eeb57f2ee38ed1604821aa38b8ad9d2 (patch)
treec49cd3e4f1dfe4ccbf2b8d00188beaa251fee028 /cache.h
parent9fec8b26eff58e1f595e8619abf1e42c07645ff8 (diff)
downloadgit-e44794706eeb57f2ee38ed1604821aa38b8ad9d2.tar.gz
git-e44794706eeb57f2ee38ed1604821aa38b8ad9d2.tar.xz
Be much more liberal about the file mode bits.
We only really care about the difference between a file being executable or not (by its owner). Everything else we leave for the user umask to decide.
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 88c2fa8d9..efeb82b6d 100644
--- a/cache.h
+++ b/cache.h
@@ -72,6 +72,9 @@ struct cache_entry {
#define ce_size(ce) cache_entry_size(ce_namelen(ce))
#define ce_stage(ce) ((CE_STAGEMASK & ntohs((ce)->ce_flags)) >> CE_STAGESHIFT)
+#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
+#define create_ce_mode(mode) htonl(S_IFREG | ce_permissions(mode))
+
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
const char *sha1_file_directory;