* Compare most of the fields in two cache entries, i.e. all except the * hashmap_entry and the name. */
| 212 | * hashmap_entry and the name. |
| 213 | */ |
| 214 | static 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 | |
| 235 | void prepare_to_write_split_index(struct index_state *istate) |
| 236 | { |
no test coverage detected