Skip to content

Commit

Permalink
Fix outdated edit can’t overwrite changes
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Aug 15, 2016
1 parent 4a19fd6 commit 8637e67
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra

![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)

##### Current tip version: 0.9.77 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
##### Current tip version: 0.9.78 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)

| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
Expand Down
2 changes: 1 addition & 1 deletion gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)

const APP_VER = "0.9.77.0814"
const APP_VER = "0.9.78.0815"

func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
Expand Down
4 changes: 2 additions & 2 deletions modules/bindata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion routers/repo/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
content := form.Content
commitChoice := form.CommitChoice
lastCommit := form.LastCommit
form.LastCommit = ctx.Repo.Commit.ID.String()

if commitChoice == "commit-to-new-branch" {
branchName = form.NewBranchName
Expand All @@ -151,7 +152,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
ctx.Data["commit_message"] = form.CommitMessage
ctx.Data["commit_choice"] = commitChoice
ctx.Data["new_branch_name"] = branchName
ctx.Data["last_commit"] = ctx.Repo.Commit.ID
ctx.Data["last_commit"] = form.LastCommit
ctx.Data["MarkdownFileExts"] = strings.Join(setting.Markdown.FileExtensions, ",")
ctx.Data["LineWrapExtensions"] = strings.Join(setting.Repository.Editor.LineWrapExtensions, ",")
ctx.Data["PreviewableFileModes"] = strings.Join(setting.Repository.Editor.PreviewableFileModes, ",")
Expand Down
2 changes: 1 addition & 1 deletion templates/.VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.77.0814
0.9.78.0815

0 comments on commit 8637e67

Please sign in to comment.