0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-02 10:22:16 +02:00
gitea/models/repo/pull_request_default.go

17 lines
420 B
Go

// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package repo
import (
"context"
"gitea.dev/models/unit"
"gitea.dev/modules/util"
)
func (repo *Repository) GetPullRequestTargetBranch(ctx context.Context) string {
unitPRConfig := repo.MustGetUnit(ctx, unit.TypePullRequests).PullRequestsConfig()
return util.IfZero(unitPRConfig.DefaultTargetBranch, repo.DefaultBranch)
}