forked from forgejo/forgejo
Removed unnecessary conversions (#7557)
No need to convert to the same type.
This commit is contained in:
parent
2f75766532
commit
54d96c79b5
24 changed files with 39 additions and 46 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue