diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2013-12-04 23:19:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-06 12:56:12 -0800 |
commit | 5f3eb7674082a52dea6c6252752509b05a3bfe0a (patch) | |
tree | ec0f2b95958699a94a2375f8c9c5493ea6d09260 /submodule.c | |
parent | 8ea31d279681533c0b4c8eb1d61b18e95da55df0 (diff) | |
download | git-hv/submodule-ignore-fix.tar.gz |
disable complete ignorance of submodules for index <-> HEAD diffhv/submodule-ignore-fix
If the value of ignore for submodules is set to "all" we would not show
whats actually committed during status or diff. This can result in the
user committing unexpected submodule references. Lets be nicer and always
show whats in the index.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index 7d8b000ab4..c28a926daf 100644 --- a/submodule.c +++ b/submodule.c @@ -304,6 +304,16 @@ int parse_submodule_config_option(const char *var, const char *value) return 0; } +void enforce_no_complete_ignore_submodule(struct diff_options *diffopt) +{ + DIFF_OPT_SET(diffopt, NO_IGNORE_SUBMODULE); + if (DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG) && + DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)) { + DIFF_OPT_CLR(diffopt, IGNORE_SUBMODULES); + DIFF_OPT_SET(diffopt, IGNORE_DIRTY_SUBMODULES); + } +} + void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *arg) { @@ -311,9 +321,11 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, DIFF_OPT_CLR(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES); DIFF_OPT_CLR(diffopt, IGNORE_DIRTY_SUBMODULES); - if (!strcmp(arg, "all")) + if (!strcmp(arg, "all")) { + if (DIFF_OPT_TST(diffopt, NO_IGNORE_SUBMODULE)) + return; DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES); - else if (!strcmp(arg, "untracked")) + } else if (!strcmp(arg, "untracked")) DIFF_OPT_SET(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES); else if (!strcmp(arg, "dirty")) DIFF_OPT_SET(diffopt, IGNORE_DIRTY_SUBMODULES); |