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 {
return
}
}
- //os.Setenv("repoId", strconv.Itoa(int(repo.Id)))
- //os.Setenv("repoName", repoName)
isWrite := In(verb, COMMANDS_WRITE)
isRead := In(verb, COMMANDS_READONLY)
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()