mirror of
https://github.com/go-gitea/gitea
synced 2025-07-07 02:57:20 +00:00
Backport #13511 Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
@ -690,7 +690,6 @@ func RepoRefByType(refType RepoRefType) macaron.Handler {
|
||||
err error
|
||||
)
|
||||
|
||||
// For API calls.
|
||||
if ctx.Repo.GitRepo == nil {
|
||||
repoPath := models.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
|
||||
ctx.Repo.GitRepo, err = git.OpenRepository(repoPath)
|
||||
@ -759,7 +758,7 @@ func RepoRefByType(refType RepoRefType) macaron.Handler {
|
||||
|
||||
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(refName)
|
||||
if err != nil {
|
||||
ctx.NotFound("GetCommit", nil)
|
||||
ctx.NotFound("GetCommit", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user