summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-23 17:22:33 +0800
committerslene <vslene@gmail.com>2014-03-23 17:22:33 +0800
commit91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1 (patch)
tree56b8ccca8b4bf7f9427898450da5f9ee7712853a
parent406afa3c32eab4782291ca01eea273f2df25748d (diff)
parentc4287bafabb96f3970bf629ff225c48112d008d9 (diff)
downloadgitea-91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1.tar.gz
gitea-91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1.zip
Merge branch 'master' of github.com:gogits/gogs
-rw-r--r--serve.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/serve.go b/serve.go
index 54296049d5..2f7a9d6052 100644
--- a/serve.go
+++ b/serve.go
@@ -15,7 +15,7 @@ import (
"strings"
"github.com/codegangsta/cli"
- "github.com/qiniu/log"
+ "github.com/gogits/gogs/modules/log"
"github.com/gogits/git"
"github.com/gogits/gogs/models"
@@ -104,8 +104,6 @@ func runServ(k *cli.Context) {
repoName = repoName[:len(repoName)-4]
}
- //os.Setenv("userName", user.Name)
- //os.Setenv("userId", strconv.Itoa(int(user.Id)))
repo, err := models.GetRepositoryByName(user.Id, repoName)
var isExist bool = true
if err != nil {
@@ -116,8 +114,6 @@ func runServ(k *cli.Context) {
return
}
}
- //os.Setenv("repoId", strconv.Itoa(int(repo.Id)))
- //os.Setenv("repoName", repoName)
isWrite := In(verb, COMMANDS_WRITE)
isRead := In(verb, COMMANDS_READONLY)
@@ -187,17 +183,22 @@ func runServ(k *cli.Context) {
b := bytes.NewBufferString(s)
gitcmd.Stdout = io.MultiWriter(os.Stdout, b)
- gitcmd.Stdin = io.MultiReader(os.Stdin, b)
+ //gitcmd.Stdin = io.MultiReader(os.Stdin, b)
+ gitcmd.Stdin = os.Stdin
gitcmd.Stderr = os.Stderr
if err = gitcmd.Run(); err != nil {
println("execute command error:", err.Error())
}
+ if !strings.HasPrefix(cmd, "git-receive-pack") {
+ return
+ }
+
// update
- w, _ := os.Create("serve.log")
- defer w.Close()
- log.SetOutput(w)
+ //w, _ := os.Create("serve.log")
+ //defer w.Close()
+ //log.SetOutput(w)
var t = "ok refs/heads/"
var i int
@@ -226,7 +227,7 @@ func runServ(k *cli.Context) {
return
}
if ref, ok = refs[refname]; !ok {
- println("unknow reference name", refname)
+ println("unknow reference name -", refname, "-")
return
}
l, err = ref.AllCommits()