Skip to content

Commit e6c4a20

Browse files
committed
make pagination optional on GetUserMirrorRepositories
1 parent 9749c35 commit e6c4a20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/repo.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,9 @@ func GetUserRepositories(opts *SearchRepoOptions) ([]*Repository, error) {
17661766
sess.And("is_private=?", false)
17671767
}
17681768

1769-
sess = opts.setSessionPagination(sess)
1769+
if opts.Page != 0 {
1770+
sess = opts.setSessionPagination(sess)
1771+
}
17701772

17711773
repos := make([]*Repository, 0, opts.PageSize)
17721774
return repos, opts.setSessionPagination(sess).Find(&repos)

0 commit comments

Comments
 (0)