mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-27 04:07:08 +00:00
add commit view
This commit is contained in:
parent
e656609b0d
commit
3ceb008e1f
4 changed files with 48 additions and 26 deletions
|
@ -69,7 +69,7 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
|
||||
// Directory and file list.
|
||||
files, err := models.GetReposFiles(params["username"], params["reponame"],
|
||||
params["branchname"], treename)
|
||||
params["branchname"], params["commitid"], treename)
|
||||
if err != nil {
|
||||
log.Error("repo.Single(GetReposFiles): %v", err)
|
||||
ctx.Render.Error(404)
|
||||
|
@ -90,13 +90,14 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
}
|
||||
|
||||
// Get latest commit according username and repo name
|
||||
commit, err := models.GetLastestCommit(params["username"], params["reponame"])
|
||||
commit, err := models.GetCommit(params["username"], params["reponame"],
|
||||
params["branchname"], params["commitid"])
|
||||
if err != nil {
|
||||
log.Error("repo.Single(GetLastestCommit): %v", err)
|
||||
log.Error("repo.Single(GetCommit): %v", err)
|
||||
ctx.Render.Error(404)
|
||||
return
|
||||
}
|
||||
ctx.Data["LatestCommit"] = commit
|
||||
ctx.Data["CurrentCommit"] = commit
|
||||
|
||||
var readmeFile *models.RepoFile
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue