From ba27d71abea437af2f0612a8960eea651ec2df59 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 28 Aug 2016 04:31:42 -0700 Subject: Web editor: improve edit file --- routers/repo/editor.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'routers/repo/editor.go') diff --git a/routers/repo/editor.go b/routers/repo/editor.go index e30b06c6..4a82f291 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -22,7 +22,6 @@ import ( const ( EDIT_FILE base.TplName = "repo/editor/edit" EDIT_DIFF_PREVIEW base.TplName = "repo/editor/diff_preview" - NEW_DIFF_PREVIEW base.TplName = "repo/editor/diff_preview_new" DELETE_FILE base.TplName = "repo/editor/delete" ) @@ -289,15 +288,9 @@ func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm) { entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treePath) if err != nil { - if git.IsErrNotExist(err) { - ctx.Data["FileContent"] = content - ctx.HTML(200, NEW_DIFF_PREVIEW) - } else { - ctx.Error(500, "GetTreeEntryByPath: "+err.Error()) - } + ctx.Error(500, "GetTreeEntryByPath: "+err.Error()) return - } - if entry.IsDir() { + } else if entry.IsDir() { ctx.Error(422) return } -- cgit v1.2.3