diff --git a/.gopmfile b/.gopmfile index 9857af3502..ae92d45e3f 100644 --- a/.gopmfile +++ b/.gopmfile @@ -19,6 +19,9 @@ github.com/gogits/gfm= github.com/gogits/cache= github.com/gogits/session= github.com/gogits/webdav= +github.com/martini-contrib/oauth2= +github.com/martini-contrib/sessions= +code.google.com/p/goauth2= [res] include=templates|public|conf diff --git a/models/publickey.go b/models/publickey.go index 3f2fcabd3b..ed47ff209d 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -77,8 +77,8 @@ func init() { // PublicKey represents a SSH key of user. type PublicKey struct { Id int64 - OwnerId int64 `xorm:"index"` - Name string `xorm:"unique not null"` + OwnerId int64 `xorm:"unique(s) index not null"` + Name string `xorm:"unique(s) not null"` Fingerprint string Content string `xorm:"TEXT not null"` Created time.Time `xorm:"created"` diff --git a/routers/repo/repo.go b/routers/repo/repo.go index ae51c55139..bc41345a89 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -246,10 +246,10 @@ func Http(ctx *middleware.Context, params martini.Params) { reponame = reponame[:len(reponame)-4] } + dir := models.RepoPath(username, reponame) prefix := path.Join("/", username, params["reponame"]) server := webdav.NewServer( - models.RepoPath(username, reponame), - prefix, true) + dir, prefix, true) server.ServeHTTP(ctx.ResponseWriter, ctx.Req) }