summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-03-16 22:04:33 +0800
committerGitHub <noreply@github.com>2018-03-16 22:04:33 +0800
commit9e5d0a09eb7370daedb1cf572d25ffa150eacf17 (patch)
treef39cbf6a572bda0e82caec7ef1697ceb70e37f1e /models/repo.go
parent4163cdf3ea6d6ca43b694de0c15cc93659d6c2b3 (diff)
downloadgitea-9e5d0a09eb7370daedb1cf572d25ffa150eacf17.tar.gz
gitea-9e5d0a09eb7370daedb1cf572d25ffa150eacf17.zip
Global code search support (#3664)
* add global code search on explore * fix bug when no anyone public repos * change the icon * fix typo and add UnitTypeCode check for login non-admin user * fix ui description when no match
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index cddd57dc38..e9b3307d9a 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1945,6 +1945,12 @@ func GetRepositoryByID(id int64) (*Repository, error) {
return getRepositoryByID(x, id)
}
+// GetRepositoriesMapByIDs returns the repositories by given id slice.
+func GetRepositoriesMapByIDs(ids []int64) (map[int64]*Repository, error) {
+ var repos = make(map[int64]*Repository, len(ids))
+ return repos, x.In("id", ids).Find(&repos)
+}
+
// GetUserRepositories returns a list of repositories of given user.
func GetUserRepositories(userID int64, private bool, page, pageSize int, orderBy string) ([]*Repository, error) {
if len(orderBy) == 0 {