| 2074 | } |
| 2075 | |
| 2076 | static 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 | |
| 2097 | static void submodule_reset_index(const char *path, const char *super_prefix) |
| 2098 | { |
no test coverage detected