Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0af3cb

Browse files
committed
submodule: correctly delimit the keys to use for lookup
The regex we use to look at the gitmodules file does not correctly delimit the name of submodule which we want to look up and puts '.*' straight after the name, maching on any submodule which has the seeked submodule as a prefix of its name. Add the missing '\.' in the regex so we want a full stop to exist both before and after the submodule name.
1 parent e8e848a commit e0af3cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ int git_submodule_reload(git_submodule *sm, int force)
13851385

13861386
git_buf_sets(&path, "submodule\\.");
13871387
git_buf_text_puts_escape_regex(&path, sm->name);
1388-
git_buf_puts(&path, ".*");
1388+
git_buf_puts(&path, "\\..*");
13891389

13901390
if (git_buf_oom(&path)) {
13911391
error = -1;

0 commit comments

Comments
 (0)