1
0
Fork 0
forked from forgejo/forgejo

Fix some slice append usages (#26778) (#26798)

Backport #26778 by @harryzcy

Co-authored-by: Chongyi Zheng <git@zcy.dev>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 4013f3f600)
This commit is contained in:
Giteabot 2023-08-30 00:13:24 +08:00 committed by Earl Warren
parent 1d228e6ee9
commit 4d2b4008d3
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 11 additions and 13 deletions

View file

@ -114,12 +114,12 @@ func (t *TemporaryUploadRepository) LsFiles(filenames ...string) ([]string, erro
return nil, err
}
filelist := make([]string, len(filenames))
fileList := make([]string, 0, len(filenames))
for _, line := range bytes.Split(stdOut.Bytes(), []byte{'\000'}) {
filelist = append(filelist, string(line))
fileList = append(fileList, string(line))
}
return filelist, nil
return fileList, nil
}
// RemoveFilesFromIndex removes the given files from the index