| 313 | fprintf(stderr, _("After fixing the above paths, you may want to run `git sparse-checkout reapply`.\n")); |
| 314 | } |
| 315 | static int check_submodule_move_head(const struct cache_entry *ce, |
| 316 | const char *old_id, |
| 317 | const char *new_id, |
| 318 | struct unpack_trees_options *o) |
| 319 | { |
| 320 | unsigned flags = SUBMODULE_MOVE_HEAD_DRY_RUN; |
| 321 | const struct submodule *sub = submodule_from_ce(ce); |
| 322 | |
| 323 | if (!sub) |
| 324 | return 0; |
| 325 | |
| 326 | if (o->reset) |
| 327 | flags |= SUBMODULE_MOVE_HEAD_FORCE; |
| 328 | |
| 329 | if (submodule_move_head(ce->name, o->super_prefix, old_id, new_id, |
| 330 | flags)) |
| 331 | return add_rejected_path(o, ERROR_WOULD_LOSE_SUBMODULE, ce->name); |
| 332 | return 0; |
| 333 | } |
| 334 | |
| 335 | /* |
| 336 | * Perform the loading of the repository's gitmodules file. This function is |
no test coverage detected