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

Function match_stat_with_submodule

diff-lib.c:88–107  ·  view source on GitHub ↗

* Has a file changed or has a submodule new commits or a dirty work tree? * * Return 1 when changes are detected, 0 otherwise. If the DIRTY_SUBMODULES * option is set, the caller does not only want to know if a submodule is * modified at all but wants to know all the conditions that are met (new * commits, untracked content and/or modified content). */

Source from the content-addressed store, hash-verified

86 * commits, untracked content and/or modified content).
87 */
88static int match_stat_with_submodule(struct diff_options *diffopt,
89 const struct cache_entry *ce,
90 struct stat *st, unsigned ce_option,
91 unsigned *dirty_submodule)
92{
93 int changed = ie_match_stat(diffopt->repo->index, ce, st, ce_option);
94 if (S_ISGITLINK(ce->ce_mode)) {
95 struct diff_flags orig_flags = diffopt->flags;
96 if (!diffopt->flags.override_submodule_config)
97 set_diffopt_flags_from_submodule_config(diffopt, ce->name);
98 if (diffopt->flags.ignore_submodules)
99 changed = 0;
100 else if (!diffopt->flags.ignore_dirty_submodules &&
101 (!changed || diffopt->flags.dirty_submodules))
102 *dirty_submodule = is_submodule_modified(ce->name,
103 diffopt->flags.ignore_untracked_in_submodules);
104 diffopt->flags = orig_flags;
105 }
106 return changed;
107}
108
109void run_diff_files(struct rev_info *revs, unsigned int option)
110{

Callers 2

run_diff_filesFunction · 0.85
get_stat_dataFunction · 0.85

Calls 3

ie_match_statFunction · 0.85
is_submodule_modifiedFunction · 0.85

Tested by

no test coverage detected