You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

branch.go 626B

123456789101112131415161718192021222324252627
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package repo
  5. import (
  6. "github.com/go-martini/martini"
  7. "github.com/gogits/gogs/modules/middleware"
  8. )
  9. func Branches(ctx *middleware.Context, params martini.Params) {
  10. brs, err := ctx.Repo.GitRepo.GetBranches()
  11. if err != nil {
  12. ctx.Handle(404, "repo.Branches", err)
  13. return
  14. } else if len(brs) == 0 {
  15. ctx.Handle(404, "repo.Branches", nil)
  16. return
  17. }
  18. ctx.Data["Branches"] = brs
  19. ctx.Data["IsRepoToolbarBranches"] = true
  20. ctx.HTML(200, "repo/branches")
  21. }