Skip to content

Commit 29e5cc3

Browse files
committed
fine tune
1 parent adb668a commit 29e5cc3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/git/commit.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,19 @@ func configParseSubModules(rd io.Reader) (*ObjectCache, error) {
385385
submoduleCache := newObjectCache()
386386
var subModule *SubModule
387387
for scanner.Scan() {
388-
if strings.HasPrefix(scanner.Text(), "[") {
388+
line := strings.TrimSpace(scanner.Text())
389+
if strings.HasPrefix(line, "[") {
389390
if subModule != nil {
390391
submoduleCache.Set(subModule.Name, subModule)
391392
subModule = nil
392393
}
393-
if strings.HasPrefix(scanner.Text(), "[submodule") {
394+
if strings.HasPrefix(line, "[submodule") {
394395
subModule = &SubModule{}
395396
}
396397
continue
397398
}
398399
if subModule != nil {
399-
fields := strings.Split(scanner.Text(), "=")
400+
fields := strings.Split(line, "=")
400401
k := strings.TrimSpace(fields[0])
401402
if k == "path" {
402403
subModule.Name = strings.TrimSpace(fields[1])

0 commit comments

Comments
 (0)