aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repofiles
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2019-07-23 20:50:39 +0200
committerzeripath <art27@cantab.net>2019-07-23 19:50:39 +0100
commit54d96c79b5b9f3d5d47aed59729ae779968fbecb (patch)
tree3d74fa2aecf3a9c5a23a1ec0c7e66fca270216aa /modules/repofiles
parent2f75766532fbf30883c05e93ef01c19268216c45 (diff)
downloadgitea-54d96c79b5b9f3d5d47aed59729ae779968fbecb.tar.gz
gitea-54d96c79b5b9f3d5d47aed59729ae779968fbecb.zip
Removed unnecessary conversions (#7557)
No need to convert to the same type.
Diffstat (limited to 'modules/repofiles')
-rw-r--r--modules/repofiles/update.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go
index f011017a5e..38f2f22c95 100644
--- a/modules/repofiles/update.go
+++ b/modules/repofiles/update.go
@@ -317,7 +317,7 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up
if encoding != "UTF-8" {
charsetEncoding, _ := charset.Lookup(encoding)
if charsetEncoding != nil {
- result, _, err := transform.String(charsetEncoding.NewEncoder(), string(content))
+ result, _, err := transform.String(charsetEncoding.NewEncoder(), content)
if err != nil {
// Look if we can't encode back in to the original we should just stick with utf-8
log.Error("Error re-encoding %s (%s) as %s - will stay as UTF-8: %v", opts.TreePath, opts.FromTreePath, encoding, err)