summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-08-03 18:19:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-03 20:11:01 (GMT)
commitfdfa9e97dbffdc6868a1a046456c0ad67dda9e29 (patch)
tree6fec7609ce4f82cc001f9a103032dd00772c6d9d /submodule.c
parent492c6c46da7847370d8ce0e6d369ae62215b6f8e (diff)
downloadgit-fdfa9e97dbffdc6868a1a046456c0ad67dda9e29.zip
git-fdfa9e97dbffdc6868a1a046456c0ad67dda9e29.tar.gz
git-fdfa9e97dbffdc6868a1a046456c0ad67dda9e29.tar.bz2
submodule: don't rely on overlayed config when setting diffopts
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directory for the ignore field. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c
index 59e3d08..a320438 100644
--- a/submodule.c
+++ b/submodule.c
@@ -165,8 +165,16 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
{
const struct submodule *submodule = submodule_from_path(&null_oid, path);
if (submodule) {
- if (submodule->ignore)
- handle_ignore_submodules_arg(diffopt, submodule->ignore);
+ const char *ignore;
+ char *key;
+
+ key = xstrfmt("submodule.%s.ignore", submodule->name);
+ if (repo_config_get_string_const(the_repository, key, &ignore))
+ ignore = submodule->ignore;
+ free(key);
+
+ if (ignore)
+ handle_ignore_submodules_arg(diffopt, ignore);
else if (is_gitmodules_unmerged(&the_index))
DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
}