summaryrefslogtreecommitdiffstats
path: root/modules/git/batch_reader.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-07-09 13:58:06 +0200
committerGitHub <noreply@github.com>2023-07-09 11:58:06 +0000
commit887a683af97b570a0fb117068c980f3086133ae4 (patch)
treec9d5d41c40a9d2fbeb40a8be27a60d5c13132b69 /modules/git/batch_reader.go
parent115f40e43368fefc776232a2df289b2fcadbb11d (diff)
downloadgitea-887a683af97b570a0fb117068c980f3086133ae4.tar.gz
gitea-887a683af97b570a0fb117068c980f3086133ae4.zip
Update tool dependencies, lock govulncheck and actionlint (#25655)
- Update all tool dependencies - Lock `govulncheck` and `actionlint` to their latest tags --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/git/batch_reader.go')
-rw-r--r--modules/git/batch_reader.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/modules/git/batch_reader.go b/modules/git/batch_reader.go
index 75539c0d0a..891e8a2384 100644
--- a/modules/git/batch_reader.go
+++ b/modules/git/batch_reader.go
@@ -148,27 +148,25 @@ func CatFileBatch(ctx context.Context, repoPath string) (WriteCloserError, *bufi
func ReadBatchLine(rd *bufio.Reader) (sha []byte, typ string, size int64, err error) {
typ, err = rd.ReadString('\n')
if err != nil {
- return
+ return sha, typ, size, err
}
if len(typ) == 1 {
typ, err = rd.ReadString('\n')
if err != nil {
- return
+ return sha, typ, size, err
}
}
idx := strings.IndexByte(typ, ' ')
if idx < 0 {
log.Debug("missing space typ: %s", typ)
- err = ErrNotExist{ID: string(sha)}
- return
+ return sha, typ, size, ErrNotExist{ID: string(sha)}
}
sha = []byte(typ[:idx])
typ = typ[idx+1:]
idx = strings.IndexByte(typ, ' ')
if idx < 0 {
- err = ErrNotExist{ID: string(sha)}
- return
+ return sha, typ, size, ErrNotExist{ID: string(sha)}
}
sizeStr := typ[idx+1 : len(typ)-1]
@@ -285,14 +283,12 @@ func ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fn
// Read the Mode & fname
readBytes, err = rd.ReadSlice('\x00')
if err != nil {
- return
+ return mode, fname, sha, n, err
}
idx := bytes.IndexByte(readBytes, ' ')
if idx < 0 {
log.Debug("missing space in readBytes ParseTreeLine: %s", readBytes)
-
- err = &ErrNotExist{}
- return
+ return mode, fname, sha, n, &ErrNotExist{}
}
n += idx + 1
@@ -319,7 +315,7 @@ func ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fn
}
n += len(fnameBuf)
if err != nil {
- return
+ return mode, fname, sha, n, err
}
fnameBuf = fnameBuf[:len(fnameBuf)-1]
fname = fnameBuf
@@ -331,7 +327,7 @@ func ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fn
read, err = rd.Read(shaBuf[idx:20])
n += read
if err != nil {
- return
+ return mode, fname, sha, n, err
}
idx += read
}