summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLibravatar Linus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 22:26:31 -0700
committerLibravatar Linus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 22:26:31 -0700
commite44794706eeb57f2ee38ed1604821aa38b8ad9d2 (patch)
treec49cd3e4f1dfe4ccbf2b8d00188beaa251fee028 /cache.h
parent[PATCH] Do not run useless show-diff on unmerged paths repeatedly. (diff)
downloadtgif-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 88c2fa8d95..efeb82b6dc 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;