@@ -1198,10 +1198,8 @@ func Repositories(opts *SearchRepoOptions) (_ RepositoryList, err error) {
1198
1198
return nil , fmt .Errorf ("Repo: %v" , err )
1199
1199
}
1200
1200
1201
- if opts .Searcher != nil || opts .Starred {
1202
- if err = repos .loadAttributes (x ); err != nil {
1203
- return nil , fmt .Errorf ("LoadAttributes: %v" , err )
1204
- }
1201
+ if err = repos .loadAttributes (x ); err != nil {
1202
+ return nil , fmt .Errorf ("LoadAttributes: %v" , err )
1205
1203
}
1206
1204
1207
1205
return repos , nil
@@ -1743,10 +1741,8 @@ func GetRecentUpdatedRepositories(opts *SearchRepoOptions) (repos RepositoryList
1743
1741
return nil , fmt .Errorf ("Repo: %v" , err )
1744
1742
}
1745
1743
1746
- if opts .Searcher != nil || opts .Starred {
1747
- if err = repos .loadAttributes (x ); err != nil {
1748
- return nil , fmt .Errorf ("LoadAttributes: %v" , err )
1749
- }
1744
+ if err = repos .loadAttributes (x ); err != nil {
1745
+ return nil , fmt .Errorf ("LoadAttributes: %v" , err )
1750
1746
}
1751
1747
1752
1748
return repos , nil
@@ -1781,14 +1777,15 @@ func GetPrivateRepositoryCount(u *User) (int64, error) {
1781
1777
1782
1778
// SearchRepoOptions holds the search options
1783
1779
type SearchRepoOptions struct {
1784
- Keyword string
1785
- OwnerID int64
1786
- Searcher * User //ID of the person who's seeking
1787
- OrderBy string
1788
- Private bool // Include private repositories in results
1789
- Starred bool
1790
- Page int
1791
- PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
1780
+ Keyword string
1781
+ OwnerID int64
1782
+ Searcher * User //ID of the person who's seeking
1783
+ OrderBy string
1784
+ Private bool // Include private repositories in results
1785
+ Starred bool
1786
+ Page int
1787
+ IsProfile bool
1788
+ PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
1792
1789
}
1793
1790
1794
1791
// SearchRepositoryByName takes keyword and part of repository name to search,
@@ -1856,7 +1853,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos RepositoryList, _ in
1856
1853
return nil , 0 , fmt .Errorf ("Repo: %v" , err )
1857
1854
}
1858
1855
1859
- if opts . Searcher != nil || opts .Starred {
1856
+ if ! opts .IsProfile {
1860
1857
if err = repos .loadAttributes (x ); err != nil {
1861
1858
return nil , 0 , fmt .Errorf ("LoadAttributes: %v" , err )
1862
1859
}
0 commit comments