diff options
author | 6543 <6543@obermui.de> | 2022-10-15 16:40:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 16:40:32 +0200 |
commit | a33ff822ffc84b0d99d122ca9dabfedc583e9f8c (patch) | |
tree | 4b5b2af3c3d19e745aea52767ef05b07ad1d46e4 /services/wiki/wiki_test.go | |
parent | 677af6ac57295a9e8795a8ab3f29e284f2247fb6 (diff) | |
download | gitea-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.go | 6 |
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) |