aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/repo_search_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-10 09:27:50 +0800
committerGitHub <noreply@github.com>2021-12-10 09:27:50 +0800
commit719bddcd76610a63dadc8555760072957a11cf30 (patch)
tree0df26092fba7e3e21444fe493e6b349473b6b0cb /integrations/repo_search_test.go
parentfb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff)
downloadgitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz
gitea-719bddcd76610a63dadc8555760072957a11cf30.zip
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
Diffstat (limited to 'integrations/repo_search_test.go')
-rw-r--r--integrations/repo_search_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/integrations/repo_search_test.go b/integrations/repo_search_test.go
index 56d89fee30..0782988363 100644
--- a/integrations/repo_search_test.go
+++ b/integrations/repo_search_test.go
@@ -8,7 +8,7 @@ import (
"net/http"
"testing"
- "code.gitea.io/gitea/models"
+ repo_model "code.gitea.io/gitea/models/repo"
code_indexer "code.gitea.io/gitea/modules/indexer/code"
"code.gitea.io/gitea/modules/setting"
@@ -31,7 +31,7 @@ func resultFilenames(t testing.TB, doc *HTMLDoc) []string {
func TestSearchRepo(t *testing.T) {
defer prepareTestEnv(t)()
- repo, err := models.GetRepositoryByOwnerAndName("user2", "repo1")
+ repo, err := repo_model.GetRepositoryByOwnerAndName("user2", "repo1")
assert.NoError(t, err)
executeIndexer(t, repo, code_indexer.UpdateRepoIndexer)
@@ -41,7 +41,7 @@ func TestSearchRepo(t *testing.T) {
setting.Indexer.IncludePatterns = setting.IndexerGlobFromString("**.txt")
setting.Indexer.ExcludePatterns = setting.IndexerGlobFromString("**/y/**")
- repo, err = models.GetRepositoryByOwnerAndName("user2", "glob")
+ repo, err = repo_model.GetRepositoryByOwnerAndName("user2", "glob")
assert.NoError(t, err)
executeIndexer(t, repo, code_indexer.UpdateRepoIndexer)
@@ -60,6 +60,6 @@ func testSearch(t *testing.T, url string, expected []string) {
assert.EqualValues(t, expected, filenames)
}
-func executeIndexer(t *testing.T, repo *models.Repository, op func(*models.Repository)) {
+func executeIndexer(t *testing.T, repo *repo_model.Repository, op func(*repo_model.Repository)) {
op(repo)
}