@@ -14,7 +14,7 @@ type Service interface {
1414 OpenRepository (ctx context.Context , repo Repository ) (* git.Repository , error )
1515 Run (ctx context.Context , c * git.Command , opts * git.RunOpts ) error
1616 RepoGitURL (repo Repository ) string
17- WalkShowRef (ctx context.Context , repo Repository , extraArgs git.TrustedCmdArgs , skip , limit int , walkfn func (sha1 , refname string ) error ) (countAll int , err error )
17+ WalkReferences (ctx context.Context , repo Repository , refType git.ObjectType , skip , limit int , walkfn func (sha1 , refname string ) error ) (int , error )
1818}
1919
2020var _ Service = & localServiceImpl {}
@@ -47,6 +47,11 @@ func (s *localServiceImpl) RepoGitURL(repo Repository) string {
4747 return s .absPath (repoRelativePath (repo ))
4848}
4949
50- func (s * localServiceImpl ) WalkShowRef (ctx context.Context , repo Repository , extraArgs git.TrustedCmdArgs , skip , limit int , walkfn func (sha1 , refname string ) error ) (int , error ) {
51- return git .WalkShowRef (ctx , s .absPath (repoRelativePath (repo )), extraArgs , skip , limit , walkfn )
50+ func (s * localServiceImpl ) WalkReferences (ctx context.Context , repo Repository , refType git.ObjectType , skip , limit int , walkfn func (sha1 , refname string ) error ) (int , error ) {
51+ gitRepo , err := s .OpenRepository (ctx , repo )
52+ if err != nil {
53+ return 0 , err
54+ }
55+ defer gitRepo .Close ()
56+ return gitRepo .WalkReferences (refType , skip , limit , walkfn )
5257}
0 commit comments