* 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). */
| 86 | * commits, untracked content and/or modified content). |
| 87 | */ |
| 88 | static 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 | |
| 109 | void run_diff_files(struct rev_info *revs, unsigned int option) |
| 110 | { |
no test coverage detected