File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1014,7 +1014,7 @@ func Routes() *web.Route {
10141014 m .Group ("/{ref}" , func () {
10151015 m .Get ("/status" , repo .GetCombinedCommitStatusByRef )
10161016 m .Get ("/statuses" , repo .GetCommitStatusesByRef )
1017- })
1017+ }, context . ReferencesGitRepo () )
10181018 }, reqRepoReader (unit .TypeCode ))
10191019 m .Group ("/git" , func () {
10201020 m .Group ("/commits" , func () {
Original file line number Diff line number Diff line change 55package utils
66
77import (
8+ "fmt"
89 "net/http"
910
1011 "code.gitea.io/gitea/modules/context"
@@ -35,12 +36,7 @@ func ResolveRefOrSha(ctx *context.APIContext, ref string) string {
3536// GetGitRefs return git references based on filter
3637func GetGitRefs (ctx * context.APIContext , filter string ) ([]* git.Reference , string , error ) {
3738 if ctx .Repo .GitRepo == nil {
38- var err error
39- ctx .Repo .GitRepo , err = git .OpenRepository (ctx , ctx .Repo .Repository .RepoPath ())
40- if err != nil {
41- return nil , "OpenRepository" , err
42- }
43- defer ctx .Repo .GitRepo .Close ()
39+ return nil , "" , fmt .Errorf ("no open git repo found in context" )
4440 }
4541 if len (filter ) > 0 {
4642 filter = "refs/" + filter
You can’t perform that action at this time.
0 commit comments