aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/commit.go
diff options
context:
space:
mode:
authorcoldWater <forsaken628@gmail.com>2024-03-19 10:20:36 +0800
committerGitHub <noreply@github.com>2024-03-19 02:20:36 +0000
commit0e183d81fc5283f9d2047472de580e4f04a046c1 (patch)
tree8f08d554fb9ed6c2f48d2e77e61f1ac348b76155 /modules/git/commit.go
parent1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8 (diff)
downloadgitea-0e183d81fc5283f9d2047472de580e4f04a046c1.tar.gz
gitea-0e183d81fc5283f9d2047472de580e4f04a046c1.zip
Fix missing error check of bufio.Scanner (#29882)
maybe more
Diffstat (limited to 'modules/git/commit.go')
-rw-r--r--modules/git/commit.go5
1 files changed, 5 insertions, 0 deletions
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
}