diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-06-23 11:21:17 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-06-23 11:21:17 -0700 |
| commit | 4ee088deb83e2a4a78ac3882168b3e8fadd4f541 (patch) | |
| tree | 0125def176094b6e47746063746ea99fce0cb715 /diff-lib.c | |
| parent | 4e4fc50cf733bb0071e43ea128b13439b93975d2 (diff) | |
| parent | 5768478edc2bccb6a3d6200e430490573140bfa6 (diff) | |
| download | git-4ee088deb83e2a4a78ac3882168b3e8fadd4f541.tar.xz | |
Merge branch 'js/defeat-ignore-submodules-config-with-explicit-addition'
Even when diff.ignoreSubmodules tells us to ignore submodule
changes, "git commit" with an index that already records changes to
submodules should include the submodule changes in the resulting
commit, but it did not.
* js/defeat-ignore-submodules-config-with-explicit-addition:
diff-lib: honor override_submodule_config flag bit
Diffstat (limited to 'diff-lib.c')
| -rw-r--r-- | diff-lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c index 60e979dc1b..1918517ebd 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -669,8 +669,15 @@ int index_differs_from(struct repository *r, setup_revisions(0, NULL, &rev, &opt); rev.diffopt.flags.quick = 1; rev.diffopt.flags.exit_with_status = 1; - if (flags) + if (flags) { diff_flags_or(&rev.diffopt.flags, flags); + /* + * Now that flags are merged, honor override_submodule_config + * and ignore_submodules from passed flags. + */ + if (flags->override_submodule_config) + rev.diffopt.flags.ignore_submodules = flags->ignore_submodules; + } rev.diffopt.ita_invisible_in_index = ita_invisible_in_index; run_diff_index(&rev, 1); has_changes = rev.diffopt.flags.has_changes; |
