"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "routers/repo/view.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

view.go  (gitea-1.13.1):view.go  (gitea-1.13.2)
skipping to change at line 13 skipping to change at line 13
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package repo package repo
import ( import (
"bytes" "bytes"
"encoding/base64" "encoding/base64"
"fmt" "fmt"
gotemplate "html/template" gotemplate "html/template"
"io"
"io/ioutil" "io/ioutil"
"net/url" "net/url"
"path" "path"
"strconv" "strconv"
"strings" "strings"
"code.gitea.io/gitea/models" "code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/cache"
"code.gitea.io/gitea/modules/charset" "code.gitea.io/gitea/modules/charset"
skipping to change at line 423 skipping to change at line 424
var err error var err error
dataRc, err = lfs.ReadMetaObject(meta) dataRc, err = lfs.ReadMetaObject(meta)
if err != nil { if err != nil {
ctx.ServerError("ReadMetaObject", err) ctx.ServerError("ReadMetaObject", err)
return return
} }
defer dataRc.Close() defer dataRc.Close()
buf = make([]byte, 1024) buf = make([]byte, 1024)
n, err = dataRc.Read(buf) 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) ctx.ServerError("Data", err)
return return
} }
buf = buf[:n] buf = buf[:n]
isTextFile = base.IsTextFile(buf) isTextFile = base.IsTextFile(buf)
ctx.Data["IsTextFile"] = isTextFile ctx.Data["IsTextFile"] = isTextFile
fileSize = meta.Size fileSize = meta.Size
ctx.Data["FileSize"] = meta.Size ctx.Data["FileSize"] = meta.Size
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)