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

Function submodule_has_dirty_index

submodule.c:2076–2095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2074}
2075
2076static int submodule_has_dirty_index(const struct submodule *sub)
2077{
2078 struct child_process cp = CHILD_PROCESS_INIT;
2079
2080 if (validate_submodule_path(sub->path) < 0)
2081 exit(128);
2082
2083 prepare_submodule_repo_env(&cp.env);
2084
2085 cp.git_cmd = 1;
2086 strvec_pushl(&cp.args, "diff-index", "--quiet",
2087 "--cached", "HEAD", NULL);
2088 cp.no_stdin = 1;
2089 cp.no_stdout = 1;
2090 cp.dir = sub->path;
2091 if (start_command(&cp))
2092 die(_("could not recurse into submodule '%s'"), sub->path);
2093
2094 return finish_command(&cp);
2095}
2096
2097static void submodule_reset_index(const char *path, const char *super_prefix)
2098{

Callers 1

submodule_move_headFunction · 0.85

Calls 6

validate_submodule_pathFunction · 0.85
strvec_pushlFunction · 0.85
start_commandFunction · 0.85
finish_commandFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected