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

Function repo_has_absorbed_submodules

submodule.c:1286–1295  ·  view source on GitHub ↗

* Returns 1 if there is at least one submodule gitdir in * $GIT_DIR/modules and 0 otherwise. This follows * submodule_name_to_gitdir(), which looks for submodules in * $GIT_DIR/modules, not $GIT_COMMON_DIR. * * A submodule can be moved to $GIT_DIR/modules manually by running "git * submodule absorbgitdirs", or it may be initialized there by "git * submodule update". */

Source from the content-addressed store, hash-verified

1284 * submodule update".
1285 */
1286static int repo_has_absorbed_submodules(struct repository *r)
1287{
1288 int ret;
1289 struct strbuf buf = STRBUF_INIT;
1290
1291 repo_git_path_append(r, &buf, "modules/");
1292 ret = file_exists(buf.buf) && !is_empty_dir(buf.buf);
1293 strbuf_release(&buf);
1294 return ret;
1295}
1296
1297static void calculate_changed_submodule_paths(struct repository *r,
1298 struct string_list *changed_submodule_names)

Callers 1

Calls 4

repo_git_path_appendFunction · 0.85
file_existsFunction · 0.85
is_empty_dirFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected