diff options
author | Jens Lehmann <Jens.Lehmann@web.de> | 2010-03-11 22:50:25 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-12 22:17:17 -0800 |
commit | ae6d5c1b6f78ef48f606e5a267915fa31b37a679 (patch) | |
tree | a996130e95e7b8406148b630b0ad6ba998b47ca4 /diff.c | |
parent | 9297f77e6d350f33de961e149dc33c77e7392db4 (diff) | |
download | git-ae6d5c1b6f78ef48f606e5a267915fa31b37a679.tar.gz |
Refactor dirty submodule detection in diff-lib.c
Moving duplicated code into the new function match_stat_with_submodule().
Replacing the implicit activation of detailed checks for the dirtiness of
submodules when DIFF_FORMAT_PATCH was selected with explicitly setting
the recently added DIFF_OPT_DIRTY_SUBMODULES option in diff_setup_done().
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2628,6 +2628,12 @@ int diff_setup_done(struct diff_options *options) */ if (options->pickaxe) DIFF_OPT_SET(options, RECURSIVE); + /* + * When patches are generated, submodules diffed against the work tree + * must be checked for dirtiness too so it can be shown in the output + */ + if (options->output_format & DIFF_FORMAT_PATCH) + DIFF_OPT_SET(options, DIRTY_SUBMODULES); if (options->detect_rename && options->rename_limit < 0) options->rename_limit = diff_rename_limit_default; |