diff options
author | slene <vslene@gmail.com> | 2014-03-30 10:13:02 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-30 10:13:02 +0800 |
commit | b27c34f39acee3bf7b6594a1f0db2183b343326c (patch) | |
tree | 47c19758b57fbaf43a3806191e4ab2f64be6978d /routers/repo/branch.go | |
parent | 41ca0ed30212367389099cfefa41587ec80d85f5 (diff) | |
download | gitea-b27c34f39acee3bf7b6594a1f0db2183b343326c.tar.gz gitea-b27c34f39acee3bf7b6594a1f0db2183b343326c.zip |
update git api. fix link... and so on
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r-- | routers/repo/branch.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index aed77cfaa5..c598db436c 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -11,21 +11,15 @@ import ( ) func Branches(ctx *middleware.Context, params martini.Params) { - if !ctx.Repo.IsValid { - return - } - - brs, err := models.GetBranches(params["username"], params["reponame"]) + brs, err := models.GetBranches(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) if err != nil { - ctx.Handle(200, "repo.Branches", err) + ctx.Handle(404, "repo.Branches", err) return } else if len(brs) == 0 { ctx.Handle(404, "repo.Branches", nil) return } - ctx.Data["Username"] = params["username"] - ctx.Data["Reponame"] = params["reponame"] ctx.Data["Branches"] = brs ctx.Data["IsRepoToolbarBranches"] = true |