Split up builtin commands into separate files from git.c
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 255e6b5cc7aa799eee892dcd3632cd0656e6dd1e..69801b02d535dbbe49535c876979cd093c6db2e1 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -106,6 +106,9 @@ static inline unsigned int create_ce_mode(unsigned int mode)
                return htonl(S_IFLNK);
        return htonl(S_IFREG | ce_permissions(mode));
 }
+#define canon_mode(mode) \
+       (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
+       S_ISLNK(mode) ? S_IFLNK : S_IFDIR)
 
 #define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)