Try a value for UNREADABLE that won't get masked out?!
diff --git a/include/git2/types.h b/include/git2/types.h
index 6522ea4..3b6e610 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -203,8 +203,8 @@ typedef enum {
GIT_FILEMODE_BLOB = 0100644,
GIT_FILEMODE_BLOB_EXECUTABLE = 0100755,
GIT_FILEMODE_LINK = 0120000,
+ GIT_FILEMODE_UNREADABLE = 0130000,
GIT_FILEMODE_COMMIT = 0160000,
- GIT_FILEMODE_UNREADABLE = 0170000,
} git_filemode_t;
typedef struct git_refspec git_refspec;