Browse Source

Minor code fix

Unknwon 8 years ago
parent
commit
67380cf47b
9 changed files with 13 additions and 12 deletions
  1. 1 1
      .gopmfile
  2. 1 1
      README.md
  3. 1 1
      glide.lock
  4. 1 1
      gogs.go
  5. 1 2
      models/user.go
  6. 0 0
      modules/bindata/bindata.go
  7. 6 4
      modules/template/template.go
  8. 1 1
      routers/repo/editor.go
  9. 1 1
      templates/.VERSION

+ 1 - 1
.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

+ 1 - 1
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  |
 |:-------------:|:-------:|:-------:|

+ 1 - 1
glide.lock

@@ -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

+ 1 - 1
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())

+ 1 - 2
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

File diff suppressed because it is too large
+ 0 - 0
modules/bindata/bindata.go


+ 6 - 4
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",

+ 1 - 1
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) {

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.9.103.1221
+0.9.104.1221

Some files were not shown because too many files changed in this diff