diff options
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 bf2244719c..428a25d568 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) { |