diff options
author | Chongyi Zheng <git@zcy.dev> | 2023-08-29 11:47:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-29 15:47:26 +0000 |
commit | ad43486cd3ab65b5b023afb5ad5b62aa862d1345 (patch) | |
tree | 92679dc459769321159d2bf343da7887e3566334 /services/repository | |
parent | 3507cad6f5d164509939754f15beef6de280e743 (diff) | |
download | gitea-ad43486cd3ab65b5b023afb5ad5b62aa862d1345.tar.gz gitea-ad43486cd3ab65b5b023afb5ad5b62aa862d1345.zip |
Fix some slice append usages (#26778)
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'services/repository')
-rw-r--r-- | services/repository/files/temp_repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/repository/files/temp_repo.go b/services/repository/files/temp_repo.go index a086d15a4f..7f6b8137ae 100644 --- a/services/repository/files/temp_repo.go +++ b/services/repository/files/temp_repo.go @@ -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 |