4 #include "read-cache-ll.h"
8 static inline unsigned int ce_mode_from_stat(const struct cache_entry
*ce
,
11 extern int trust_executable_bit
, has_symlinks
;
12 if (!has_symlinks
&& S_ISREG(mode
) &&
13 ce
&& S_ISLNK(ce
->ce_mode
))
15 if (!trust_executable_bit
&& S_ISREG(mode
)) {
16 if (ce
&& S_ISREG(ce
->ce_mode
))
18 return create_ce_mode(0666);
20 return create_ce_mode(mode
);
23 static inline int ce_to_dtype(const struct cache_entry
*ce
)
25 unsigned ce_mode
= ntohl(ce
->ce_mode
);
28 else if (S_ISDIR(ce_mode
) || S_ISGITLINK(ce_mode
))
30 else if (S_ISLNK(ce_mode
))
36 static inline int ce_path_match(struct index_state
*istate
,
37 const struct cache_entry
*ce
,
38 const struct pathspec
*pathspec
,
41 return match_pathspec(istate
, pathspec
, ce
->name
, ce_namelen(ce
), 0, seen
,
42 S_ISDIR(ce
->ce_mode
) || S_ISGITLINK(ce
->ce_mode
));
45 #endif /* READ_CACHE_H */