index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
routers
/
repo
/
editor.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Unknwon <u@gogs.io>
2016-08-31 13:59:23 -0700
committer
Unknwon <u@gogs.io>
2016-08-31 13:59:23 -0700
commit
dadd35b63647327bed02719f6cda5d25256fa49e
(
patch
)
tree
a05aa8f90afc18542b6373cdf747c39df8e67c11
/
routers/repo/editor.go
parent
c2afdf2192b9f0287968e29160e30a45a3ff1339
(
diff
)
#3559 fix template error
Diffstat
(limited to 'routers/repo/editor.go')
-rw-r--r--
routers/repo/editor.go
4
1 files changed, 1 insertions, 3 deletions
diff --git a/routers/repo/editor.go b/routers/repo/editor.go
index bf224471..428a25d5 100644
--- a/
routers/repo/editor.go
+++ b/
routers/repo/editor.go
@@ -64,9 +64,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
buf := make([]byte, 1024)
n, _ := dataRc.Read(buf)
- if n > 0 {
- buf = buf[:n]
- }
+ buf = buf[:n]
// Only text file are editable online.
if !base.IsTextFile(buf) {