Fix outdated edit can’t overwrite changes

This commit is contained in:
Unknwon 2016-08-15 02:06:35 -07:00
parent 4a19fd6441
commit 8637e67e6f
5 changed files with 7 additions and 6 deletions

View File

@ -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) ![](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 | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

View File

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.9.77.0814" const APP_VER = "0.9.78.0815"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -301,7 +301,7 @@ func confAppIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/app.ini", size: 13460, mode: os.FileMode(420), modTime: time.Unix(1471235101, 0)} info := bindataFileInfo{name: "conf/app.ini", size: 13460, mode: os.FileMode(420), modTime: time.Unix(1471250630, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -4361,7 +4361,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 55343, mode: os.FileMode(420), modTime: time.Unix(1471240680, 0)} info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 55343, mode: os.FileMode(420), modTime: time.Unix(1471250630, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }

View File

@ -129,6 +129,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
content := form.Content content := form.Content
commitChoice := form.CommitChoice commitChoice := form.CommitChoice
lastCommit := form.LastCommit lastCommit := form.LastCommit
form.LastCommit = ctx.Repo.Commit.ID.String()
if commitChoice == "commit-to-new-branch" { if commitChoice == "commit-to-new-branch" {
branchName = form.NewBranchName branchName = form.NewBranchName
@ -151,7 +152,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
ctx.Data["commit_message"] = form.CommitMessage ctx.Data["commit_message"] = form.CommitMessage
ctx.Data["commit_choice"] = commitChoice ctx.Data["commit_choice"] = commitChoice
ctx.Data["new_branch_name"] = branchName 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["MarkdownFileExts"] = strings.Join(setting.Markdown.FileExtensions, ",")
ctx.Data["LineWrapExtensions"] = strings.Join(setting.Repository.Editor.LineWrapExtensions, ",") ctx.Data["LineWrapExtensions"] = strings.Join(setting.Repository.Editor.LineWrapExtensions, ",")
ctx.Data["PreviewableFileModes"] = strings.Join(setting.Repository.Editor.PreviewableFileModes, ",") ctx.Data["PreviewableFileModes"] = strings.Join(setting.Repository.Editor.PreviewableFileModes, ",")

View File

@ -1 +1 @@
0.9.77.0814 0.9.78.0815