aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-24 15:24:23 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-24 15:24:23 -0700
commit5ed8c5b465aaeae967875d043187668bdc0dfe54 (patch)
tree57b2314040578774593e352fe5243b43e00d2f67 /builtin/submodule--helper.c
parentfixup! submodule: prevent overwriting .gitmodules on path reuse (diff)
downloadgit-5ed8c5b465aaeae967875d043187668bdc0dfe54.tar.gz
git-5ed8c5b465aaeae967875d043187668bdc0dfe54.zip
fixup! submodule: skip redundant active entries when pattern covers path
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 08a808e5c4..10cd65e343 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -3330,10 +3330,9 @@ static void configure_added_submodule(struct add_data *add_data)
char *key;
struct child_process add_submod = CHILD_PROCESS_INIT;
struct child_process add_gitmodules = CHILD_PROCESS_INIT;
-
const struct string_list *values;
- size_t i;
int matched = 0;
+
key = xstrfmt("submodule.%s.url", add_data->sm_name);
git_config_set_gently(key, add_data->realrepo);
free(key);
@@ -3385,7 +3384,7 @@ static void configure_added_submodule(struct add_data *add_data)
git_config_set_gently(key, "true");
free(key);
} else {
- for (i = 0; i < values->nr; i++) {
+ for (size_t i = 0; i < values->nr; i++) {
const char *pat = values->items[i].string;
if (!wildmatch(pat, add_data->sm_path, 0)) { /* match found */
matched = 1;