aboutsummaryrefslogtreecommitdiffstats
path: root/services/wiki/wiki_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-10-15 16:40:32 +0200
committerGitHub <noreply@github.com>2022-10-15 16:40:32 +0200
commita33ff822ffc84b0d99d122ca9dabfedc583e9f8c (patch)
tree4b5b2af3c3d19e745aea52767ef05b07ad1d46e4 /services/wiki/wiki_test.go
parent677af6ac57295a9e8795a8ab3f29e284f2247fb6 (diff)
downloadgitea-a33ff822ffc84b0d99d122ca9dabfedc583e9f8c.tar.gz
gitea-a33ff822ffc84b0d99d122ca9dabfedc583e9f8c.zip
[refactor] Use const for wiki DefaultBranch (#21466)
just a nit, that will make it easier to change things and we now have a single source of truth
Diffstat (limited to 'services/wiki/wiki_test.go')
-rw-r--r--services/wiki/wiki_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/wiki/wiki_test.go b/services/wiki/wiki_test.go
index cabeecb60a..774ef6c283 100644
--- a/services/wiki/wiki_test.go
+++ b/services/wiki/wiki_test.go
@@ -140,7 +140,7 @@ func TestRepository_AddWikiPage(t *testing.T) {
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
defer gitRepo.Close()
- masterTree, err := gitRepo.GetTree("master")
+ masterTree, err := gitRepo.GetTree(DefaultBranch)
assert.NoError(t, err)
wikiPath := NameToFilename(wikiName)
entry, err := masterTree.GetTreeEntryByPath(wikiPath)
@@ -184,7 +184,7 @@ func TestRepository_EditWikiPage(t *testing.T) {
// Now need to show that the page has been added:
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
- masterTree, err := gitRepo.GetTree("master")
+ masterTree, err := gitRepo.GetTree(DefaultBranch)
assert.NoError(t, err)
wikiPath := NameToFilename(newWikiName)
entry, err := masterTree.GetTreeEntryByPath(wikiPath)
@@ -209,7 +209,7 @@ func TestRepository_DeleteWikiPage(t *testing.T) {
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
assert.NoError(t, err)
defer gitRepo.Close()
- masterTree, err := gitRepo.GetTree("master")
+ masterTree, err := gitRepo.GetTree(DefaultBranch)
assert.NoError(t, err)
wikiPath := NameToFilename("Home")
_, err = masterTree.GetTreeEntryByPath(wikiPath)