MCPcopy Index your code
hub / github.com/git/git / copy_cache_entry

Function copy_cache_entry

read-cache-ll.h:95–111  ·  view source on GitHub ↗

* Copy the sha1 and stat state of a cache entry from one to * another. But we never change the name, or the hash state! */

Source from the content-addressed store, hash-verified

93 * another. But we never change the name, or the hash state!
94 */
95static inline void copy_cache_entry(struct cache_entry *dst,
96 const struct cache_entry *src)
97{
98 unsigned int state = dst->ce_flags & CE_HASHED;
99 int mem_pool_allocated = dst->mem_pool_allocated;
100
101 /* Don't copy hash chain and name */
102 memcpy(&dst->ce_stat_data, &src->ce_stat_data,
103 offsetof(struct cache_entry, name) -
104 offsetof(struct cache_entry, ce_stat_data));
105
106 /* Restore the hash state */
107 dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
108
109 /* Restore the mem_pool_allocated flag */
110 dst->mem_pool_allocated = mem_pool_allocated;
111}
112
113static inline unsigned create_ce_flags(unsigned stage)
114{

Callers 5

replace_entryFunction · 0.85
merged_entryFunction · 0.85
rename_index_entry_atFunction · 0.85
create_alias_ceFunction · 0.85
refresh_cache_entFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected