Skip to content

Commit d886c16

Browse files
author
chhsia0
committed
Fixed missing parameters to gitlab PR create.
1 parent aab121d commit d886c16

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

scm/driver/gitlab/pr.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ func (s *pullService) Create(ctx context.Context, repo string, input *scm.PullRe
5656
in := url.Values{}
5757
in.Set("title", input.Title)
5858
in.Set("description", input.Body)
59+
in.Set("source_branch", input.Source)
60+
in.Set("target_branch", input.Target)
5961
path := fmt.Sprintf("api/v4/projects/%s/merge_requests?%s", encode(repo), in.Encode())
6062
out := new(pr)
6163
res, err := s.client.do(ctx, "POST", path, nil, out)

scm/driver/gitlab/pr_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ func TestPullCreate(t *testing.T) {
155155

156156
gock.New("https://gitlab.com").
157157
Post("/api/v4/projects/diaspora/diaspora/merge_requests").
158-
Reply(200).
158+
MatchParam("source_branch", "fix").
159+
MatchParam("target_branch", "master").
160+
Reply(201).
159161
Type("application/json").
160162
SetHeaders(mockHeaders).
161163
File("testdata/merge.json")

0 commit comments

Comments
 (0)