diff options
author | Unknwon <u@gogs.io> | 2017-02-23 13:31:26 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-27 22:46:42 -0500 |
commit | 25cf755f3082db7c35b329a5a7abf916150c13f8 (patch) | |
tree | 8caf2e53b7586274c975dd13415baf67a59ea166 | |
parent | c7a8051a711d4a87aff5895e27e56a74fc653023 (diff) |
editor: fix compile error
-rw-r--r-- | routers/repo/editor.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/repo/editor.go b/routers/repo/editor.go index af3a300c..480ff876 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -279,8 +279,8 @@ func editFilePost(ctx *context.Context, f form.EditRepoFile, isNewFile bool) { return } - if form.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { - ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, form.NewBranchName)) + if f.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { + ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, f.NewBranchName)) } else { ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + template.EscapePound(f.TreePath)) } @@ -382,8 +382,8 @@ func DeleteFilePost(ctx *context.Context, f form.DeleteRepoFile) { return } - if form.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { - ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, form.NewBranchName)) + if f.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { + ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, f.NewBranchName)) } else { ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath)) ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName) @@ -503,8 +503,8 @@ func UploadFilePost(ctx *context.Context, f form.UploadRepoFile) { return } - if form.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { - ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, form.NewBranchName)) + if f.IsNewBrnach() && ctx.Repo.PullRequest.Allowed { + ctx.Redirect(ctx.Repo.PullRequestURL(oldBranchName, f.NewBranchName)) } else { ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + f.TreePath) } |