Fix lfs preview bug (#14428) (#14433)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
6543 2021-01-23 03:55:52 +01:00 committed by GitHub
parent 4d2a6c40f8
commit dd827d6f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ import (
"encoding/base64"
"fmt"
gotemplate "html/template"
"io"
"io/ioutil"
"net/url"
"path"
@ -420,7 +421,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
buf = make([]byte, 1024)
n, err = dataRc.Read(buf)
if err != nil {
// Error EOF don't mean there is an error, it just means we read to
// the end
if err != nil && err != io.EOF {
ctx.ServerError("Data", err)
return
}