aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r--routers/repo/http.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index b58d19489b..a6189ff2c3 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -60,8 +60,8 @@ func Http(ctx *middleware.Context, params martini.Params) {
// only public pull don't need auth
isPublicPull := !repo.IsPrivate && isPull
var askAuth = !isPublicPull || base.Service.RequireSignInView
-
var authUser *models.User
+ var authUsername, passwd string
// check access
if askAuth {
@@ -79,7 +79,7 @@ func Http(ctx *middleware.Context, params martini.Params) {
ctx.Handle(401, "no basic auth and digit auth", nil)
return
}
- authUsername, passwd, err := basicDecode(auths[1])
+ authUsername, passwd, err = basicDecode(auths[1])
if err != nil {
ctx.Handle(401, "no basic auth and digit auth", nil)
return
@@ -133,7 +133,7 @@ func Http(ctx *middleware.Context, params martini.Params) {
newCommitId := fields[1]
refName := fields[2]
- models.Update(refName, oldCommitId, newCommitId, username, reponame, authUser.Id)
+ models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id)
}
}
}