diff options
author | slene <vslene@gmail.com> | 2014-03-23 17:22:33 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-23 17:22:33 +0800 |
commit | 91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1 (patch) | |
tree | 56b8ccca8b4bf7f9427898450da5f9ee7712853a | |
parent | 406afa3c32eab4782291ca01eea273f2df25748d (diff) | |
parent | c4287bafabb96f3970bf629ff225c48112d008d9 (diff) | |
download | gitea-91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1.tar.gz gitea-91c3fc3e995fcaa968b7e0cfe11eb50f4f3549c1.zip |
Merge branch 'master' of github.com:gogits/gogs
-rw-r--r-- | serve.go | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -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() |