[PATCH 11/15] diff: ignore submodules excluded by groups
- From
Stefan Beller <sbeller@google.com>
- Date
- Apr 26, 2016, 20:50 UTC
- Message-ID
- <1461703833-10350-12-git-send-email-sbeller@google.com>
- In-Reply-To
- <1461703833-10350-1-git-send-email-sbeller@google.com>
We do not need to do anything special to initialize the `submodule_groups` pointer as the diff options setup will fill in 0 by default.
Signed-off-by: Stefan Beller <sbeller@google.com> --- diff.c | 3 +++ diff.h | 1 + 2 files changed, 4 insertions(+)
diff --git a/diff.c b/diff.c index 059123c..5808d8a 100644 --- a/diff.c +++ b/diff.c @@ -4921,10 +4921,13 @@ static int is_submodule_ignored(const char *path, struct diff_options *options) { int ignored = 0; unsigned orig_flags = options->flags; + const struct submodule *sub = submodule_from_path(null_sha1, path); if (!DIFF_OPT_TST(options, OVERRIDE_SUBMODULE_CONFIG)) set_diffopt_flags_from_submodule_config(options, path); if (DIFF_OPT_TST(options, IGNORE_SUBMODULES)) ignored = 1; + if (!submodule_in_group(options->submodule_groups, sub)) + ignored = 1; options->flags = orig_flags; return ignored; } diff --git a/diff.h b/diff.h index e7d68ed..7d499fb 100644 --- a/diff.h +++ b/diff.h @@ -178,6 +178,7 @@ struct diff_options { void *output_prefix_data; int diff_path_counter; + struct string_list *submodule_groups; }; enum color_diff {
-- 2.8.0.41.g8d9aeb3