Skip to content

Commit 5ed8c5b

Browse files
committed
fixup! submodule: skip redundant active entries when pattern covers path
1 parent 9305027 commit 5ed8c5b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3330,10 +3330,9 @@ static void configure_added_submodule(struct add_data *add_data)
33303330
char *key;
33313331
struct child_process add_submod = CHILD_PROCESS_INIT;
33323332
struct child_process add_gitmodules = CHILD_PROCESS_INIT;
3333-
33343333
const struct string_list *values;
3335-
size_t i;
33363334
int matched = 0;
3335+
33373336
key = xstrfmt("submodule.%s.url", add_data->sm_name);
33383337
git_config_set_gently(key, add_data->realrepo);
33393338
free(key);
@@ -3385,7 +3384,7 @@ static void configure_added_submodule(struct add_data *add_data)
33853384
git_config_set_gently(key, "true");
33863385
free(key);
33873386
} else {
3388-
for (i = 0; i < values->nr; i++) {
3387+
for (size_t i = 0; i < values->nr; i++) {
33893388
const char *pat = values->items[i].string;
33903389
if (!wildmatch(pat, add_data->sm_path, 0)) { /* match found */
33913390
matched = 1;

0 commit comments

Comments
 (0)