mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-21 13:38:00 +02:00
add commit view
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user