MCPcopy Create free account
hub / github.com/git/git / compare_ce_content

Function compare_ce_content

split-index.c:214–233  ·  view source on GitHub ↗

* Compare most of the fields in two cache entries, i.e. all except the * hashmap_entry and the name. */

Source from the content-addressed store, hash-verified

212 * hashmap_entry and the name.
213 */
214static int compare_ce_content(struct cache_entry *a, struct cache_entry *b)
215{
216 const unsigned int ondisk_flags = CE_STAGEMASK | CE_VALID |
217 CE_EXTENDED_FLAGS;
218 unsigned int ce_flags = a->ce_flags;
219 unsigned int base_flags = b->ce_flags;
220 int ret;
221
222 /* only on-disk flags matter */
223 a->ce_flags &= ondisk_flags;
224 b->ce_flags &= ondisk_flags;
225 ret = memcmp(&a->ce_stat_data, &b->ce_stat_data,
226 offsetof(struct cache_entry, name) -
227 offsetof(struct cache_entry, oid)) ||
228 !oideq(&a->oid, &b->oid);
229 a->ce_flags = ce_flags;
230 b->ce_flags = base_flags;
231
232 return ret;
233}
234
235void prepare_to_write_split_index(struct index_state *istate)
236{

Callers 1

Calls 1

oideqFunction · 0.85

Tested by

no test coverage detected