MCPcopy Index your code
hub / github.com/git/git / load_gitmodules_file

Function load_gitmodules_file

unpack-trees.c:344–359  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

342 * has been marked for update. This situation is specified by 'state' != NULL.
343 */
344static 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
361static struct progress *get_progress(struct unpack_trees_options *o,
362 struct index_state *index)

Callers 1

check_updatesFunction · 0.85

Calls 4

index_name_posFunction · 0.85
repo_read_gitmodulesFunction · 0.85
submodule_freeFunction · 0.85
checkout_entryFunction · 0.85

Tested by

no test coverage detected