diff: do not show submodule with untracked files as "-dirty"
Git diff reports a submodule directory as -dirty even when there are only untracked files in the submodule directory. This is inconsistent with what `git describe --dirty` says when run in the submodule directory in that state. Make `--ignore-submodules=untracked` the default for `git diff` when there is no configuration variable or command line option, so that the command would not give '-dirty' suffix to a submodule whose working tree has untracked files, to make it consistent with `git describe --dirty` that is run in the submodule working tree. And also make `--ignore-submodules=none` the default for `git status` so that the user doesn't end up deleting a submodule that has uncommitted (untracked) files. Signed-off-by: Sangeeta Jain <sangunb09@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2e673356ae
commit
8ef9312464
3
diff.c
3
diff.c
@ -4586,6 +4586,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) {
|
||||
|
||||
Reference in New Issue
Block a user