From dadd35b63647327bed02719f6cda5d25256fa49e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 31 Aug 2016 13:59:23 -0700 Subject: #3559 fix template error --- routers/repo/editor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'routers/repo/editor.go') 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) { -- cgit v1.2.3