Browse Source

routers/repo: minor code fix for PR #3758

pull/4078/head
Unknwon 8 years ago
parent
commit
2527037973
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
  1. 2
      gogs.go
  2. 23
      routers/repo/middlewares.go
  3. 9
      routers/repo/view.go
  4. 2
      templates/.VERSION

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.9.130.0131" const APP_VER = "0.9.131.0201"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

23
routers/repo/middlewares.go

@ -1,23 +0,0 @@
package repo
import (
"fmt"
"github.com/gogits/git-module"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/context"
)
func setEditorconfigIfExists(ctx *context.Context) {
ec, err := ctx.Repo.GetEditorconfig()
if err != nil && !git.IsErrNotExist(err) {
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
if err := models.CreateRepositoryNotice(description); err != nil {
ctx.Handle(500, "ErrCreatingReporitoryNotice", err)
}
return
}
ctx.Data["Editorconfig"] = ec
}

9
routers/repo/view.go

@ -211,6 +211,15 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
} }
} }
func setEditorconfigIfExists(ctx *context.Context) {
ec, err := ctx.Repo.GetEditorconfig()
if err != nil && !git.IsErrNotExist(err) {
log.Error(4, "Fail to get '.editorconfig' [%d]: %v", ctx.Repo.Repository.ID, err)
return
}
ctx.Data["Editorconfig"] = ec
}
func Home(ctx *context.Context) { func Home(ctx *context.Context) {
title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name
if len(ctx.Repo.Repository.Description) > 0 { if len(ctx.Repo.Repository.Description) > 0 {

2
templates/.VERSION

@ -1 +1 @@
0.9.130.0131 0.9.131.0201
Loading…
Cancel
Save