* Perform the loading of the repository's gitmodules file. This function is * used by 'check_update()' to perform loading of the gitmodules file in two * different situations: * (1) before removing entries from the working tree if the gitmodules file has * been marked for removal. This situation is specified by 'state' == NULL. * (2) before checking out entries to the working tree if th
| 342 | * has been marked for update. This situation is specified by 'state' != NULL. |
| 343 | */ |
| 344 | static void load_gitmodules_file(struct index_state *index, |
| 345 | struct checkout *state) |
| 346 | { |
| 347 | int pos = index_name_pos(index, GITMODULES_FILE, strlen(GITMODULES_FILE)); |
| 348 | |
| 349 | if (pos >= 0) { |
| 350 | struct cache_entry *ce = index->cache[pos]; |
| 351 | if (!state && ce->ce_flags & CE_WT_REMOVE) { |
| 352 | repo_read_gitmodules(the_repository, 0); |
| 353 | } else if (state && (ce->ce_flags & CE_UPDATE)) { |
| 354 | submodule_free(the_repository); |
| 355 | checkout_entry(ce, state, NULL, NULL); |
| 356 | repo_read_gitmodules(the_repository, 0); |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | static struct progress *get_progress(struct unpack_trees_options *o, |
| 362 | struct index_state *index) |
no test coverage detected