aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/single.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/single.go')
-rw-r--r--routers/repo/single.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index 3541dac9..c4189ad6 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -33,6 +33,13 @@ func Single(ctx *middleware.Context, params martini.Params) {
ctx.Data["Reponame"] = params["reponame"]
ctx.Data["Branchname"] = params["branchname"]
+ brs, err := models.GetBranches(params["username"], params["reponame"])
+ if err != nil {
+ ctx.Handle(200, "repo.Single", err)
+ return
+ }
+ ctx.Data["Branches"] = brs
+
var treenames []string
Paths := make([]string, 0)
@@ -43,6 +50,13 @@ func Single(ctx *middleware.Context, params martini.Params) {
}
}
+ commit, err := models.GetLastestCommit(params["username"], params["reponame"])
+ if err != nil {
+ ctx.Handle(200, "repo.Single", err)
+ return
+ }
+ ctx.Data["LatestCommit"] = commit
+
ctx.Data["Paths"] = Paths
ctx.Data["Treenames"] = treenames
ctx.Data["IsRepoToolbarSource"] = true