aboutsummaryrefslogtreecommitdiffstats
path: root/services/wiki/wiki_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-03-29 21:13:41 +0200
committerGitHub <noreply@github.com>2022-03-30 03:13:41 +0800
commit3e88af898a7b8e2697f7e4c3867c34b802d0b660 (patch)
treee8304867b9fd8d78ef0a3da7221d84fb29592c21 /services/wiki/wiki_test.go
parent889a8c268ca6a54ff5be19e61b29b10feb4a12e8 (diff)
downloadgitea-3e88af898a7b8e2697f7e4c3867c34b802d0b660.tar.gz
gitea-3e88af898a7b8e2697f7e4c3867c34b802d0b660.zip
Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
Diffstat (limited to 'services/wiki/wiki_test.go')
-rw-r--r--services/wiki/wiki_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/wiki/wiki_test.go b/services/wiki/wiki_test.go
index 928d08c828..17ec657cac 100644
--- a/services/wiki/wiki_test.go
+++ b/services/wiki/wiki_test.go
@@ -138,7 +138,7 @@ func TestRepository_AddWikiPage(t *testing.T) {
t.Parallel()
assert.NoError(t, AddWikiPage(git.DefaultContext, doer, repo, wikiName, wikiContent, commitMsg))
// Now need to show that the page has been added:
- gitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, repo.WikiPath())
+ gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
defer gitRepo.Close()
masterTree, err := gitRepo.GetTree("master")
@@ -183,7 +183,7 @@ func TestRepository_EditWikiPage(t *testing.T) {
assert.NoError(t, EditWikiPage(git.DefaultContext, doer, repo, "Home", newWikiName, newWikiContent, commitMsg))
// Now need to show that the page has been added:
- gitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, repo.WikiPath())
+ gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
masterTree, err := gitRepo.GetTree("master")
assert.NoError(t, err)
@@ -207,7 +207,7 @@ func TestRepository_DeleteWikiPage(t *testing.T) {
assert.NoError(t, DeleteWikiPage(git.DefaultContext, doer, repo, "Home"))
// Now need to show that the page has been added:
- gitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, repo.WikiPath())
+ gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
defer gitRepo.Close()
masterTree, err := gitRepo.GetTree("master")
@@ -220,7 +220,7 @@ func TestRepository_DeleteWikiPage(t *testing.T) {
func TestPrepareWikiFileName(t *testing.T) {
unittest.PrepareTestEnv(t)
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
- gitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, repo.WikiPath())
+ gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
defer gitRepo.Close()
assert.NoError(t, err)
@@ -283,7 +283,7 @@ func TestPrepareWikiFileName_FirstPage(t *testing.T) {
err = git.InitRepository(git.DefaultContext, tmpDir, true)
assert.NoError(t, err)
- gitRepo, err := git.OpenRepository(tmpDir)
+ gitRepo, err := git.OpenRepository(git.DefaultContext, tmpDir)
defer gitRepo.Close()
assert.NoError(t, err)