Skip to content

Commit 3287ce2

Browse files
authored
Fix lfs preview bug (#14428)
1 parent e35d1bf commit 3287ce2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/repo/view.go

Lines changed: 4 additions & 1 deletion
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"
@@ -435,7 +436,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
435436

436437
buf = make([]byte, 1024)
437438
n, err = dataRc.Read(buf)
438-
if err != nil {
439+
// Error EOF don't mean there is an error, it just means we read to
440+
// the end
441+
if err != nil && err != io.EOF {
439442
ctx.ServerError("Data", err)
440443
return
441444
}

0 commit comments

Comments
 (0)