diff --git a/conf/app.ini b/conf/app.ini index a3c749be0..05c7745fc 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -7,7 +7,7 @@ RUN_USER = git RUN_MODE = dev [repository] -ROOT = /Users/%(RUN_USER)s/git/gogs-repositories +ROOT = LANG_IGNS = Google Go|C|C++|Python|Ruby|C Sharp LICENSES = Apache v2 License|GPL v2|MIT License|Affero GPL|Artistic License 2.0|BSD (3-Clause) License diff --git a/modules/base/conf.go b/modules/base/conf.go index b3a987e64..fd77cfd3c 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -291,9 +291,14 @@ func NewConfigContext() { PictureService = Cfg.MustValue("picture", "SERVICE") // Determine and create root git reposiroty path. - RepoRootPath = Cfg.MustValue("repository", "ROOT") + homeDir, err := com.HomeDir() + if err != nil { + fmt.Printf("Fail to get home directory): %v\n", err) + os.Exit(2) + } + RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "git/gogs-repositories")) if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { - fmt.Printf("models.init(fail to create RepoRootPath(%s)): %v\n", RepoRootPath, err) + fmt.Printf("Fail to create RepoRootPath(%s): %v\n", RepoRootPath, err) os.Exit(2) } } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index c3d1a0d96..6ac8a5357 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -231,6 +231,12 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } + content := ctx.Query("content") + if len(content) == 0 { + ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", ctx.User.Name, ctx.Repo.Repository.Name, index)) + return + } + issue, err := models.GetIssueByIndex(ctx.Repo.Repository.Id, int64(index)) if err != nil { if err == models.ErrIssueNotExist { @@ -241,12 +247,6 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } - content := ctx.Query("content") - if len(content) == 0 { - ctx.Handle(404, "issue.Comment", err) - return - } - switch params["action"] { case "new": if err = models.CreateComment(ctx.User.Id, issue.Id, 0, 0, content); err != nil { diff --git a/templates/install.tmpl b/templates/install.tmpl index be5a69186..872982a0a 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -133,7 +133,7 @@