@@ -68,11 +68,11 @@ func (rp *RepoPool) AddRepository(repo *Repository) error {
6868 return nil
6969}
7070
71- // Mirror will trigger mirror on every repo in foreground with given timeout.
71+ // MirrorAll will trigger mirror on every repo in foreground with given timeout.
7272// It will error out if any of the repository mirror errors.
73- // Ideally Mirror should be used for the first mirror cycle to ensure repositories are
73+ // Ideally MirrorAll should be used for the first mirror cycle to ensure repositories are
7474// successfully mirrored
75- func (rp * RepoPool ) Mirror (ctx context.Context , timeout time.Duration ) error {
75+ func (rp * RepoPool ) MirrorAll (ctx context.Context , timeout time.Duration ) error {
7676 for _ , repo := range rp .repos {
7777 mCtx , cancel := context .WithTimeout (ctx , timeout )
7878 err := repo .Mirror (mCtx )
@@ -85,6 +85,16 @@ func (rp *RepoPool) Mirror(ctx context.Context, timeout time.Duration) error {
8585 return nil
8686}
8787
88+ // Mirror is wrapper around repositories Mirror method
89+ func (rp * RepoPool ) Mirror (ctx context.Context , remote string ) error {
90+ repo , err := rp .Repository (remote )
91+ if err != nil {
92+ return err
93+ }
94+
95+ return repo .Mirror (ctx )
96+ }
97+
8898// StartLoop will start mirror loop on all repositories
8999// if its not already started
90100func (rp * RepoPool ) StartLoop () {
@@ -175,6 +185,27 @@ func (rp *RepoPool) ChangedFiles(ctx context.Context, remote, hash string) ([]st
175185 return repo .ChangedFiles (ctx , hash )
176186}
177187
188+ // ChangedFilesBetweenRefs is wrapper around repositories ChangedFilesBetweenRefs method
189+ // git diff --name-only HEAD...refs/pull/13179/head
190+ // git diff --name-only --merge-base HEAD refs/pull/13179/head
191+ func (rp * RepoPool ) ChangedFilesBetweenRefs (ctx context.Context , remote , ref1 , ref2 string ) ([]string , error ) {
192+ repo , err := rp .Repository (remote )
193+ if err != nil {
194+ return nil , err
195+ }
196+ return repo .ChangedFilesBetweenRefs (ctx , ref1 , ref2 )
197+ }
198+
199+ // CommitsBetweenRefs is wrapper around repositories CommitsBetweenRefs method
200+ // git rev-list ^HEAD refs/pull/13179/head
201+ func (rp * RepoPool ) CommitsBetweenRefs (ctx context.Context , remote , ref1 , ref2 string ) ([]string , error ) {
202+ repo , err := rp .Repository (remote )
203+ if err != nil {
204+ return nil , err
205+ }
206+ return repo .CommitsBetweenRefs (ctx , ref1 , ref2 )
207+ }
208+
178209// ObjectExists is wrapper around repositories ObjectExists method
179210func (rp * RepoPool ) ObjectExists (ctx context.Context , remote , obj string ) error {
180211 repo , err := rp .Repository (remote )
0 commit comments