aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorChongyi Zheng <git@zcy.dev>2023-08-29 11:47:26 -0400
committerGitHub <noreply@github.com>2023-08-29 15:47:26 +0000
commitad43486cd3ab65b5b023afb5ad5b62aa862d1345 (patch)
tree92679dc459769321159d2bf343da7887e3566334 /services/repository
parent3507cad6f5d164509939754f15beef6de280e743 (diff)
downloadgitea-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.go6
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