|
|
@ -52,7 +52,7 @@ func Single(ctx *middleware.Context, params martini.Params) { |
|
|
|
files, err := models.GetReposFiles(params["username"], params["reponame"], |
|
|
|
files, err := models.GetReposFiles(params["username"], params["reponame"], |
|
|
|
params["branchname"], treename) |
|
|
|
params["branchname"], treename) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(200, "repo.Single", err) |
|
|
|
ctx.Handle(200, "repo.Single(GetReposFiles)", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["Username"] = params["username"] |
|
|
|
ctx.Data["Username"] = params["username"] |
|
|
@ -62,7 +62,7 @@ func Single(ctx *middleware.Context, params martini.Params) { |
|
|
|
// Branches.
|
|
|
|
// Branches.
|
|
|
|
brs, err := models.GetBranches(params["username"], params["reponame"]) |
|
|
|
brs, err := models.GetBranches(params["username"], params["reponame"]) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(200, "repo.Single", err) |
|
|
|
ctx.Handle(200, "repo.Single(GetBranches)", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["Branches"] = brs |
|
|
|
ctx.Data["Branches"] = brs |
|
|
@ -80,7 +80,7 @@ func Single(ctx *middleware.Context, params martini.Params) { |
|
|
|
// Get latest commit according username and repo name
|
|
|
|
// Get latest commit according username and repo name
|
|
|
|
commit, err := models.GetLastestCommit(params["username"], params["reponame"]) |
|
|
|
commit, err := models.GetLastestCommit(params["username"], params["reponame"]) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(200, "repo.Single", err) |
|
|
|
ctx.Handle(200, "repo.Single(GetLastestCommit)", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["LatestCommit"] = commit |
|
|
|
ctx.Data["LatestCommit"] = commit |
|
|
|