1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-13 14:07:20 +00:00

Fix some slice append usages (#26778)

Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
Chongyi Zheng
2023-08-29 11:47:26 -04:00
committed by GitHub
parent 3507cad6f5
commit ad43486cd3
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