| 592 | } |
| 593 | |
| 594 | void unlink_entry(const struct cache_entry *ce, const char *super_prefix) |
| 595 | { |
| 596 | const struct submodule *sub = submodule_from_ce(ce); |
| 597 | if (sub) { |
| 598 | /* state.force is set at the caller. */ |
| 599 | submodule_move_head(ce->name, super_prefix, "HEAD", NULL, |
| 600 | SUBMODULE_MOVE_HEAD_FORCE); |
| 601 | } |
| 602 | if (check_leading_path(ce->name, ce_namelen(ce), 1) >= 0) |
| 603 | return; |
| 604 | if (remove_or_warn(ce->ce_mode, ce->name)) |
| 605 | return; |
| 606 | schedule_dir_for_removal(ce->name, ce_namelen(ce)); |
| 607 | } |
| 608 | |
| 609 | int remove_or_warn(unsigned int mode, const char *file) |
| 610 | { |
no test coverage detected