fixup! submodule: skip redundant active entries when pattern covers path

Junio C Hamano committed Jul 24, 2025 at 15:24 UTC 5ed8c5b465aaeae967875d043187668bdc0dfe54
1 file changed +2 -3
builtin/submodule--helper.c
+2 -3
@@ -3330,10 +3330,9 @@ static void configure_added_submodule(struct add_data *add_data)
3330 char *key;
3331 struct child_process add_submod = CHILD_PROCESS_INIT;
3332 struct child_process add_gitmodules = CHILD_PROCESS_INIT;
3333 -
3333 const struct string_list *values;
3335 - size_t i;
3334 int matched = 0;
3335 +
3336 key = xstrfmt("submodule.%s.url", add_data->sm_name);
3337 git_config_set_gently(key, add_data->realrepo);
3338 free(key);
@@ -3385,7 +3384,7 @@ static void configure_added_submodule(struct add_data *add_data)
3384 git_config_set_gently(key, "true");
3385 free(key);
3386 } else {
3388 - for (i = 0; i < values->nr; i++) {
3387 + for (size_t i = 0; i < values->nr; i++) {
3388 const char *pat = values->items[i].string;
3389 if (!wildmatch(pat, add_data->sm_path, 0)) { /* match found */
3390 matched = 1;