diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-11 13:30:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-11 13:30:05 -0700 |
commit | dd261b1727e4c251e761b45295c00d1cfcf52b8b (patch) | |
tree | e0bbd6802458ca0c37e35e6477200ad44ef5055c /cache.h | |
parent | 03b1558208f02df6f5a74d22fcc8a751f9470b95 (diff) | |
parent | 5d80ef5a6e727bbecd7d892a5043bae25f7ca5e2 (diff) | |
download | git-dd261b1727e4c251e761b45295c00d1cfcf52b8b.tar.gz |
Merge branch 'rs/unpack-trees-plug-leak'
* rs/unpack-trees-plug-leak:
unpack-trees: free cache_entry array members for merges
diff-lib, read-tree, unpack-trees: mark cache_entry array paramters const
diff-lib, read-tree, unpack-trees: mark cache_entry pointers const
unpack-trees: create working copy of merge entry in merged_entry
unpack-trees: factor out dup_entry
read-cache: mark cache_entry pointers const
cache: mark cache_entry pointers const
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -190,7 +190,8 @@ struct cache_entry { * another. But we never change the name, or the hash state! */ #define CE_STATE_MASK (CE_HASHED | CE_UNHASHED) -static inline void copy_cache_entry(struct cache_entry *dst, struct cache_entry *src) +static inline void copy_cache_entry(struct cache_entry *dst, + const struct cache_entry *src) { unsigned int state = dst->ce_flags & CE_STATE_MASK; @@ -222,7 +223,8 @@ static inline unsigned int create_ce_mode(unsigned int mode) return S_IFGITLINK; return S_IFREG | ce_permissions(mode); } -static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode) +static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce, + unsigned int mode) { extern int trust_executable_bit, has_symlinks; if (!has_symlinks && S_ISREG(mode) && @@ -480,8 +482,8 @@ extern void *read_blob_data_from_index(struct index_state *, const char *, unsig #define CE_MATCH_RACY_IS_DIRTY 02 /* do stat comparison even if CE_SKIP_WORKTREE is true */ #define CE_MATCH_IGNORE_SKIP_WORKTREE 04 -extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); -extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); +extern int ie_match_stat(const struct index_state *, const struct cache_entry *, struct stat *, unsigned int); +extern int ie_modified(const struct index_state *, const struct cache_entry *, struct stat *, unsigned int); #define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */ |