summaryrefslogtreecommitdiffstats
path: root/models/git_diff.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/git_diff.go')
-rw-r--r--models/git_diff.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/git_diff.go b/models/git_diff.go
index a94ea0abc7..725806699e 100644
--- a/models/git_diff.go
+++ b/models/git_diff.go
@@ -244,8 +244,8 @@ func ParsePatch(maxlines int, reader io.Reader) (*Diff, error) {
buf.WriteString("\n")
}
}
- charsetLabel, err := base.DetectEncoding(buf.Bytes())
- if charsetLabel != "UTF-8" && err == nil {
+ charsetLabel := base.DetectEncoding(buf.Bytes())
+ if charsetLabel != "UTF-8" {
encoding, _ := charset.Lookup(charsetLabel)
if encoding != nil {
d := encoding.NewDecoder()