| 439 | } |
| 440 | |
| 441 | static 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 | |
| 481 | int checkout_entry_ca(struct cache_entry *ce, struct conv_attrs *ca, |
| 482 | const struct checkout *state, char *topath, |
no test coverage detected