From 0e183d81fc5283f9d2047472de580e4f04a046c1 Mon Sep 17 00:00:00 2001 From: coldWater Date: Tue, 19 Mar 2024 10:20:36 +0800 Subject: Fix missing error check of bufio.Scanner (#29882) maybe more --- modules/git/commit.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/git/commit.go') diff --git a/modules/git/commit.go b/modules/git/commit.go index facb632bd9..789a2e8f69 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -9,6 +9,7 @@ import ( "bytes" "context" "errors" + "fmt" "io" "os/exec" "strconv" @@ -396,6 +397,10 @@ func (c *Commit) GetSubModules() (*ObjectCache, error) { } } } + err = scanner.Err() + if err != nil { + return nil, fmt.Errorf("scan: %w", err) + } return c.submoduleCache, nil } -- cgit v1.2.3