summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-26 17:33:45 -0500
committerUnknwon <u@gogs.io>2015-11-26 17:33:45 -0500
commitc50a3503e6e8ece0dabd109932a72fe093c3cab3 (patch)
treed9918c4b9c5d5efc94771cae22231fdcc0796102 /modules
parent2b10fdc4dcb987b347b031f460cf4f02fd48a31a (diff)
downloadgitea-c50a3503e6e8ece0dabd109932a72fe093c3cab3.tar.gz
gitea-c50a3503e6e8ece0dabd109932a72fe093c3cab3.zip
introduce git-shell
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/repo_form.go18
-rw-r--r--modules/middleware/repo.go6
-rw-r--r--modules/process/manager.go3
3 files changed, 21 insertions, 6 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go
index 8e10dc24db..b876f27910 100644
--- a/modules/auth/repo_form.go
+++ b/modules/auth/repo_form.go
@@ -237,3 +237,21 @@ type EditReleaseForm struct {
func (f *EditReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
+
+// __ __.__ __ .__
+// / \ / \__| | _|__|
+// \ \/\/ / | |/ / |
+// \ /| | <| |
+// \__/\ / |__|__|_ \__|
+// \/ \/
+
+type NewWikiForm struct {
+ Title string `binding:"Required"`
+ Content string
+ Message string
+}
+
+// FIXME: use code generation to generate this method.
+func (f *NewWikiForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+ return validate(errs, ctx.Data, f, ctx.Locale)
+}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 9fe454dd46..210e563730 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -311,11 +311,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
return
}
ctx.Repo.GitRepo = gitRepo
- ctx.Repo.RepoLink, err = repo.RepoLink()
- if err != nil {
- ctx.Handle(500, "RepoLink", err)
- return
- }
+ ctx.Repo.RepoLink = repo.RepoLink()
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name
diff --git a/modules/process/manager.go b/modules/process/manager.go
index 68c33315d0..1f98ca7cfb 100644
--- a/modules/process/manager.go
+++ b/modules/process/manager.go
@@ -113,7 +113,8 @@ func Remove(pid int64) {
func Kill(pid int64) error {
for i, proc := range Processes {
if proc.Pid == pid {
- if proc.Cmd.Process != nil && proc.Cmd.ProcessState != nil && !proc.Cmd.ProcessState.Exited() {
+ if proc.Cmd != nil && proc.Cmd.Process != nil &&
+ proc.Cmd.ProcessState != nil && !proc.Cmd.ProcessState.Exited() {
if err := proc.Cmd.Process.Kill(); err != nil {
return fmt.Errorf("fail to kill process(%d/%s): %v", proc.Pid, proc.Description, err)
}