aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-04-10 23:02:08 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-04-10 23:02:08 +0800
commita24c0b92e4ad847fbd774e604e80017368f25495 (patch)
treef417cdfa41fc31086d2f95d65d9dc9383a082086 /routers/repo
parent88d873c67f2940325a2a7a8aa851372c9afb983d (diff)
downloadgitea-a24c0b92e4ad847fbd774e604e80017368f25495.tar.gz
gitea-a24c0b92e4ad847fbd774e604e80017368f25495.zip
bug fixed
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/http.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 993de51f93..5aa3139f85 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -82,7 +82,8 @@ func Http(ctx *middleware.Context, params martini.Params) {
return
}
- newUser := &models.User{Passwd: passwd}
+ newUser := &models.User{Passwd: passwd, Salt: authUser.Salt}
+
newUser.EncodePasswd()
if authUser.Passwd != newUser.Passwd {
ctx.Handle(401, "no basic auth and digit auth", nil)
@@ -112,7 +113,10 @@ func Http(ctx *middleware.Context, params martini.Params) {
}
}
- config := Config{base.RepoRootPath, "git", true, true}
+ config := Config{base.RepoRootPath, "git", true, true, func(rpc string, input []byte) {
+ //fmt.Println("rpc:", rpc)
+ //fmt.Println("input:", string(input))
+ }}
handler := HttpBackend(&config)
handler(ctx.ResponseWriter, ctx.Req)
@@ -135,11 +139,11 @@ type route struct {
}
type Config struct {
- ReposRoot string
- GitBinPath string
- UploadPack bool
- ReceivePack bool
- OnPushSucceed func()
+ ReposRoot string
+ GitBinPath string
+ UploadPack bool
+ ReceivePack bool
+ OnSucceed func(rpc string, input []byte)
}
type handler struct {
@@ -243,7 +247,9 @@ func serviceRpc(rpc string, hr handler) {
io.Copy(w, stdout)
cmd.Wait()
- hr.Config.OnPushSucceed()
+ if hr.Config.OnSucceed != nil {
+ hr.Config.OnSucceed(rpc, input)
+ }
}
func getInfoRefs(hr handler) {