MCPcopy Create free account
hub / github.com/git/git / submodules_absorb_gitdir_if_needed

Function submodules_absorb_gitdir_if_needed

builtin/rm.c:74–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74static void submodules_absorb_gitdir_if_needed(void)
75{
76 int i;
77 for (i = 0; i < list.nr; i++) {
78 const char *name = list.entry[i].name;
79 int pos;
80 const struct cache_entry *ce;
81
82 pos = index_name_pos(the_repository->index, name, strlen(name));
83 if (pos < 0) {
84 pos = get_ours_cache_pos(name, -pos - 1);
85 if (pos < 0)
86 continue;
87 }
88 ce = the_repository->index->cache[pos];
89
90 if (!S_ISGITLINK(ce->ce_mode) ||
91 !file_exists(ce->name) ||
92 is_empty_dir(name))
93 continue;
94
95 if (!submodule_uses_gitfile(name))
96 absorb_git_dir_into_superproject(name, NULL);
97 }
98}
99
100static int check_local_mod(struct object_id *head, int index_only)
101{

Callers 1

cmd_rmFunction · 0.85

Calls 6

index_name_posFunction · 0.85
get_ours_cache_posFunction · 0.85
file_existsFunction · 0.85
is_empty_dirFunction · 0.85
submodule_uses_gitfileFunction · 0.85

Tested by

no test coverage detected