Merge branch 'main' into feature/bots

This commit is contained in:
Jason Song
2022-12-05 14:31:00 +08:00
163 changed files with 471 additions and 447 deletions

View File

@ -264,7 +264,7 @@ func (r *Repository) GetEditorconfig(optCommit ...*git.Commit) (*editorconfig.Ed
// RetrieveBaseRepo retrieves base repository
func RetrieveBaseRepo(ctx *Context, repo *repo_model.Repository) {
// Non-fork repository will not return error in this method.
if err := repo.GetBaseRepo(); err != nil {
if err := repo.GetBaseRepo(ctx); err != nil {
if repo_model.IsErrRepoNotExist(err) {
repo.IsFork = false
repo.ForkID = 0
@ -335,7 +335,7 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
ownerName := ctx.Params(":username")
previousRepoName := ctx.Params(":reponame")
repo, err := repo_model.GetRepositoryByID(redirectRepoID)
repo, err := repo_model.GetRepositoryByID(ctx, redirectRepoID)
if err != nil {
ctx.ServerError("GetRepositoryByID", err)
return
@ -410,7 +410,7 @@ func RepoIDAssignment() func(ctx *Context) {
repoID := ctx.ParamsInt64(":repoid")
// Get repository.
repo, err := repo_model.GetRepositoryByID(repoID)
repo, err := repo_model.GetRepositoryByID(ctx, repoID)
if err != nil {
if repo_model.IsErrRepoNotExist(err) {
ctx.NotFound("GetRepositoryByID", nil)