Skip to content

Commit 57bc3eb

Browse files
committed
Fix bug
1 parent 2932f07 commit 57bc3eb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

modules/git/submodule.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ func parseSubmoduleContent(r io.Reader) (*ObjectCache, error) {
4141

4242
// Section header [section]
4343
if strings.HasPrefix(line, "[submodule") && strings.HasSuffix(line, "]") {
44-
subModules.Set(path, &SubModule{
45-
Path: path,
46-
URL: url,
47-
Branch: branch,
48-
})
44+
if path != "" && url != "" {
45+
subModules.Set(path, &SubModule{
46+
Path: path,
47+
URL: url,
48+
Branch: branch,
49+
})
50+
}
4951
state = 1
5052
path = ""
5153
url = ""

0 commit comments

Comments
 (0)