diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-23 17:10:09 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-23 17:10:09 +0800 |
commit | 21a138a75a379c1c8d1142b6bdf3f855c0361634 (patch) | |
tree | 93ca11df9c526cf0109894ff64a2ba00f8a74bb6 /serve.go | |
parent | d594bb386f92455079e56b48f5add16b05609dea (diff) | |
download | gitea-21a138a75a379c1c8d1142b6bdf3f855c0361634.tar.gz gitea-21a138a75a379c1c8d1142b6bdf3f855c0361634.zip |
bug fxied
Diffstat (limited to 'serve.go')
-rw-r--r-- | serve.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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,13 +183,18 @@ 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() |