]> git.ipfire.org Git - thirdparty/git.git/commit
submodule: skip redundant active entries when pattern covers path
authorK Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Thu, 24 Jul 2025 15:24:18 +0000 (20:54 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Jul 2025 20:35:08 +0000 (13:35 -0700)
commitbb10dcf5730356b9ef70d40eca2335e9d406954a
tree0800fe82f6fac69e33141a9da01b9e32f84e0114
parent1fa06ceddf1ea01bd85e277471ba79330666f037
submodule: skip redundant active entries when pattern covers path

configure_added_submodule always writes an explicit
submodule.<name>.active entry, even when the new
path is already matched by submodule.active
patterns. This leads to unnecessary and cluttered configuration.

change the logic to centralize wildmatch-based pattern lookup,
in configure_added_submodule. Wrap the active-entry write in a conditional
that only fires when that helper reports no existing pattern covers the
submodule’s path.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7413-submodule-is-active.sh