Skip to content

Commit dd827d6

Browse files
6543lunny
andauthored
Fix lfs preview bug (#14428) (#14433)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 4d2a6c4 commit dd827d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/repo/view.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/base64"
1111
"fmt"
1212
gotemplate "html/template"
13+
"io"
1314
"io/ioutil"
1415
"net/url"
1516
"path"
@@ -420,7 +421,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
420421

421422
buf = make([]byte, 1024)
422423
n, err = dataRc.Read(buf)
423-
if err != nil {
424+
// Error EOF don't mean there is an error, it just means we read to
425+
// the end
426+
if err != nil && err != io.EOF {
424427
ctx.ServerError("Data", err)
425428
return
426429
}

0 commit comments

Comments
 (0)