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

Function mark_colliding_entries

entry.c:441–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441static void mark_colliding_entries(const struct checkout *state,
442 struct cache_entry *ce, struct stat *st)
443{
444 struct repo_config_values *cfg = repo_config_values(the_repository);
445 int trust_ino = cfg->check_stat;
446
447#if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
448 trust_ino = 0;
449#endif
450
451 ce->ce_flags |= CE_MATCHED;
452
453 /* TODO: audit for interaction with sparse-index. */
454 ensure_full_index(state->istate);
455 for (size_t i = 0; i < state->istate->cache_nr; i++) {
456 struct cache_entry *dup = state->istate->cache[i];
457
458 if (dup == ce) {
459 /*
460 * Parallel checkout doesn't create the files in index
461 * order. So the other side of the collision may appear
462 * after the given cache_entry in the array.
463 */
464 if (parallel_checkout_status() == PC_RUNNING)
465 continue;
466 else
467 break;
468 }
469
470 if (dup->ce_flags & (CE_MATCHED | CE_VALID | CE_SKIP_WORKTREE))
471 continue;
472
473 if ((trust_ino && !match_stat_data(&dup->ce_stat_data, st)) ||
474 paths_collide(ce->name, dup->name)) {
475 dup->ce_flags |= CE_MATCHED;
476 break;
477 }
478 }
479}
480
481int checkout_entry_ca(struct cache_entry *ce, struct conv_attrs *ca,
482 const struct checkout *state, char *topath,

Callers 1

checkout_entry_caFunction · 0.85

Calls 5

ensure_full_indexFunction · 0.85
parallel_checkout_statusFunction · 0.85
match_stat_dataFunction · 0.85
paths_collideFunction · 0.85
repo_config_valuesClass · 0.70

Tested by

no test coverage detected