summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-01-25 14:19:18 -0800
committerJunio C Hamano <gitster@pobox.com>2021-01-25 14:19:18 -0800
commit080627942802e767b068a491f3d349227f4e2cdc (patch)
treee229ae62bfe315afc0d784b3752958f981b46d96 /diff.c
parentdfcd90506998c1de8d8ef86431c86ef9ed626c30 (diff)
parent8ef93124645f89c45c9ec3edd3b268b38154061a (diff)
downloadgit-080627942802e767b068a491f3d349227f4e2cdc.tar.gz
Merge branch 'sj/untracked-files-in-submodule-directory-is-not-dirty'
"git diff" showed a submodule working tree with untracked cruft as "Submodule commit <objectname>-dirty", but a natural expectation is that the "-dirty" indicator would align with "git describe --dirty", which does not consider having untracked files in the working tree as source of dirtiness. The inconsistency has been fixed. * sj/untracked-files-in-submodule-directory-is-not-dirty: diff: do not show submodule with untracked files as "-dirty"
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 2253ec8802..69e3bc00ed 100644
--- a/diff.c
+++ b/diff.c
@@ -4593,6 +4593,9 @@ void repo_diff_setup(struct repository *r, struct diff_options *options)
options->orderfile = diff_order_file_cfg;
+ if (!options->flags.ignore_submodule_set)
+ options->flags.ignore_untracked_in_submodules = 1;
+
if (diff_no_prefix) {
options->a_prefix = options->b_prefix = "";
} else if (!diff_mnemonic_prefix) {