]> source.dussan.org Git - gitea.git/commitdiff
bug fxied
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 23 Mar 2014 09:10:09 +0000 (17:10 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Sun, 23 Mar 2014 09:10:09 +0000 (17:10 +0800)
serve.go

index d4ce138c1cc7a396c572bde17b88ccdd7aabec07..16df38f420bf8073511b324ab20c4549b6a9705c 100644 (file)
--- a/serve.go
+++ b/serve.go
@@ -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()