From b894c3f07366019d7e4c4b8d0f13c6dfe5520c79 Mon Sep 17 00:00:00 2001 From: Clouding Date: Wed, 18 Mar 2020 21:53:34 +0800 Subject: [PATCH] Fix mr create wrong target project --- internal/gitlab/project/merge_request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/gitlab/project/merge_request.go b/internal/gitlab/project/merge_request.go index bd78062..2fc1281 100644 --- a/internal/gitlab/project/merge_request.go +++ b/internal/gitlab/project/merge_request.go @@ -72,8 +72,11 @@ func (s *mergeRequestsService) Create() error { u := *s.baseURL u.Path = path.Join(s.project, "merge_requests", "new") - q := make(url.Values) + q := u.Query() q.Set("merge_request[source_branch]", currentBranch) + q.Set("merge_request[target_branch]", defaultBranch) + q.Set("merge_request[source_project_id]", strconv.Itoa(project.ID)) + q.Set("merge_request[target_project_id]", strconv.Itoa(project.ID)) u.RawQuery = q.Encode() fmt.Fprintf(s.out, "\nOpening %s in your browser\n", u.String())