diff options
| author | Junio C Hamano <gitster@pobox.com> | 2010-08-18 12:36:25 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2010-08-18 12:36:25 -0700 |
| commit | cc34bb0b0279a79117978cf220d70b1c14da05ca (patch) | |
| tree | 83ea20e7109b8d96caf0aeed855656d03968f0df /diff-lib.c | |
| parent | 06d11b2e8d9d78d01212024f0f410e4193cbb5bd (diff) | |
| parent | 90e14525f22c2980d4375dcb5d79e6d5da293a78 (diff) | |
| download | git-cc34bb0b0279a79117978cf220d70b1c14da05ca.tar.gz | |
Merge branch 'jl/submodule-ignore-diff'
* jl/submodule-ignore-diff:
Add tests for the diff.ignoreSubmodules config option
Add the 'diff.ignoreSubmodules' config setting
Submodules: Use "ignore" settings from .gitmodules too for diff and status
Submodules: Add the new "ignore" config option for diff and status
Conflicts:
diff.c
Diffstat (limited to 'diff-lib.c')
| -rw-r--r-- | diff-lib.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/diff-lib.c b/diff-lib.c index 8b8978ae6d..392ce2bef0 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -68,11 +68,16 @@ static int match_stat_with_submodule(struct diff_options *diffopt, unsigned ce_option, unsigned *dirty_submodule) { int changed = ce_match_stat(ce, st, ce_option); - if (S_ISGITLINK(ce->ce_mode) - && !DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES) - && !DIFF_OPT_TST(diffopt, IGNORE_DIRTY_SUBMODULES) - && (!changed || DIFF_OPT_TST(diffopt, DIRTY_SUBMODULES))) { - *dirty_submodule = is_submodule_modified(ce->name, DIFF_OPT_TST(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES)); + if (S_ISGITLINK(ce->ce_mode)) { + unsigned orig_flags = diffopt->flags; + if (!DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG)) + set_diffopt_flags_from_submodule_config(diffopt, ce->name); + if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)) + changed = 0; + else if (!DIFF_OPT_TST(diffopt, IGNORE_DIRTY_SUBMODULES) + && (!changed || DIFF_OPT_TST(diffopt, DIRTY_SUBMODULES))) + *dirty_submodule = is_submodule_modified(ce->name, DIFF_OPT_TST(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES)); + diffopt->flags = orig_flags; } return changed; } |
