Browse Source

Minor code fix

pull/3781/merge
Unknwon 8 years ago
parent
commit
67380cf47b
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
  1. 2
      .gopmfile
  2. 2
      README.md
  3. 2
      glide.lock
  4. 2
      gogs.go
  5. 3
      models/user.go
  6. 8
      modules/bindata/bindata.go
  7. 10
      modules/template/template.go
  8. 2
      routers/repo/editor.go
  9. 2
      templates/.VERSION

2
.gopmfile

@ -20,7 +20,7 @@ github.com/go-xorm/xorm = commit:3ad0b42
github.com/gogits/chardet = commit:2404f77
github.com/gogits/cron = commit:7f3990a
github.com/gogits/git-module = commit:7129215
github.com/gogits/go-gogs-client = commit:3693f6a
github.com/gogits/go-gogs-client = commit:98046bb
github.com/gogits/go-libravatar = commit:cd1abbd
github.com/issue9/identicon = commit:d36b545
github.com/jaytaylor/html2text = commit:52d9b78

2
README.md

@ -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.103 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/))
##### Current tip version: 0.9.104 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/))
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|

2
glide.lock generated

@ -45,7 +45,7 @@ imports:
- name: github.com/gogits/git-module
version: 71292151e50d262429f29515dd077d7f5beb8c66
- name: github.com/gogits/go-gogs-client
version: 3693f6a1a71302d146590845e35fc7fd530aae4e
version: 98046bb98061fc6baa5bb86359af0b7c300d384a
- name: github.com/gogits/go-libravatar
version: cd1abbd55d09b793672732a7a1dfdaa12a40dfd0
- name: github.com/issue9/identicon

2
gogs.go

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

3
models/user.go

@ -23,6 +23,7 @@ import (
"github.com/Unknwon/com"
"github.com/go-xorm/xorm"
"github.com/nfnt/resize"
"golang.org/x/crypto/pbkdf2"
"github.com/gogits/git-module"
api "github.com/gogits/go-gogs-client"
@ -32,8 +33,6 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/markdown"
"github.com/gogits/gogs/modules/setting"
"golang.org/x/crypto/pbkdf2"
)
type UserType int

8
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

10
modules/template/template.go

@ -96,10 +96,8 @@ func NewFuncMap() []template.FuncMap {
"ShortSha": base.ShortSha,
"MD5": base.EncodeMD5,
"ActionContent2Commits": ActionContent2Commits,
"EscapePound": func(str string) string {
return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str)
},
"RenderCommitMessage": RenderCommitMessage,
"EscapePound": EscapePound,
"RenderCommitMessage": RenderCommitMessage,
"ThemeColorMetaTag": func() string {
return setting.UI.ThemeColorMetaTag
},
@ -268,6 +266,10 @@ func ActionContent2Commits(act Actioner) *models.PushCommits {
return push
}
func EscapePound(str string) string {
return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str)
}
func DiffTypeToStr(diffType int) string {
diffTypes := map[int]string{
1: "add", 2: "modify", 3: "del", 4: "rename",

2
routers/repo/editor.go

@ -264,7 +264,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
return
}
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(form.TreePath))
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + template.EscapePound(form.TreePath))
}
func EditFilePost(ctx *context.Context, form auth.EditRepoFileForm) {

2
templates/.VERSION

@ -1 +1 @@
0.9.103.1221
0.9.104.1221
Loading…
Cancel
Save