mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
[TESTS] Fix usage of LoadRepoCommit
It loads the Commit with a temporary open GitRepo. This is incorrect, the GitRepo should be open as long as the Commit can be used. This mainly removes the usage of this function as it's not needed.
This commit is contained in:
parent
24bbf051c3
commit
b44dcf553c
9 changed files with 84 additions and 190 deletions
|
@ -52,8 +52,13 @@ func createRepoAndGetContext(t *testing.T, files []string, deleteMdReadme bool)
|
|||
ctx, _ := contexttest.MockContext(t, "user1/readmetest")
|
||||
ctx.SetParams(":id", fmt.Sprint(repo.ID))
|
||||
contexttest.LoadRepo(t, ctx, repo.ID)
|
||||
contexttest.LoadGitRepo(t, ctx)
|
||||
contexttest.LoadRepoCommit(t, ctx)
|
||||
return ctx, f
|
||||
|
||||
return ctx, func() {
|
||||
f()
|
||||
ctx.Repo.GitRepo.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func TestRepoView_FindReadme(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue