Create Pull Requests to specified branches
instead of always using DefaultBranch. This means that target needs always gets specified now.
This commit is contained in:
@@ -603,14 +603,14 @@ func (gitea *GiteaTransport) CreateRepositoryIfNotExist(git Git, org, repoName s
|
|||||||
|
|
||||||
func (gitea *GiteaTransport) CreatePullRequestIfNotExist(repo *models.Repository, srcId, targetId, title, body string) (*models.PullRequest, error) {
|
func (gitea *GiteaTransport) CreatePullRequestIfNotExist(repo *models.Repository, srcId, targetId, title, body string) (*models.PullRequest, error) {
|
||||||
prOptions := models.CreatePullRequestOption{
|
prOptions := models.CreatePullRequestOption{
|
||||||
Base: repo.DefaultBranch,
|
Base: targetId,
|
||||||
Head: srcId,
|
Head: srcId,
|
||||||
Title: title,
|
Title: title,
|
||||||
Body: body,
|
Body: body,
|
||||||
}
|
}
|
||||||
|
|
||||||
if pr, err := gitea.client.Repository.RepoGetPullRequestByBaseHead(
|
if pr, err := gitea.client.Repository.RepoGetPullRequestByBaseHead(
|
||||||
repository.NewRepoGetPullRequestByBaseHeadParams().WithOwner(repo.Owner.UserName).WithRepo(repo.Name).WithBase(repo.DefaultBranch).WithHead(srcId),
|
repository.NewRepoGetPullRequestByBaseHeadParams().WithOwner(repo.Owner.UserName).WithRepo(repo.Name).WithBase(targetId).WithHead(srcId),
|
||||||
gitea.transport.DefaultAuthentication,
|
gitea.transport.DefaultAuthentication,
|
||||||
); err == nil {
|
); err == nil {
|
||||||
return pr.Payload, nil
|
return pr.Payload, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user