Skip to content

Commit fdfa9e9

Browse files
bmwillgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 492c6c4 commit fdfa9e9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

submodule.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,16 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
165165
{
166166
const struct submodule *submodule = submodule_from_path(&null_oid, path);
167167
if (submodule) {
168-
if (submodule->ignore)
169-
handle_ignore_submodules_arg(diffopt, submodule->ignore);
168+
const char *ignore;
169+
char *key;
170+
171+
key = xstrfmt("submodule.%s.ignore", submodule->name);
172+
if (repo_config_get_string_const(the_repository, key, &ignore))
173+
ignore = submodule->ignore;
174+
free(key);
175+
176+
if (ignore)
177+
handle_ignore_submodules_arg(diffopt, ignore);
170178
else if (is_gitmodules_unmerged(&the_index))
171179
DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
172180
}

0 commit comments

Comments
 (0)