Fix missing branch in release bug (#3108)
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/git"
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
|
||||
@ -51,6 +52,15 @@ func LoadUser(t *testing.T, ctx *context.Context, userID int64) {
|
||||
ctx.User = models.AssertExistsAndLoadBean(t, &models.User{ID: userID}).(*models.User)
|
||||
}
|
||||
|
||||
// LoadGitRepo load a git repo into a test context. Requires that ctx.Repo has
|
||||
// already been populated.
|
||||
func LoadGitRepo(t *testing.T, ctx *context.Context) {
|
||||
assert.NoError(t, ctx.Repo.Repository.GetOwner())
|
||||
var err error
|
||||
ctx.Repo.GitRepo, err = git.OpenRepository(ctx.Repo.Repository.RepoPath())
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
type mockLocale struct{}
|
||||
|
||||
func (l mockLocale) Language() string {
|
||||
|
Reference in New Issue
Block a user