Skip to content

Commit 019654a

Browse files
committed
Merge pull request #40 from jubianchi/mr-description
Handle MR description
2 parents a47cfc1 + f773bbd commit 019654a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lib/Gitlab/Api/MergeRequests.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ public function show($project_id, $mr_id)
1717
return $this->get('projects/'.urlencode($project_id).'/merge_request/'.urlencode($mr_id));
1818
}
1919

20-
public function create($project_id, $source, $target, $title, $assignee = null, $target_project_id = null)
20+
public function create($project_id, $source, $target, $title, $assignee = null, $target_project_id = null, $description = null)
2121
{
2222
if ($target_project_id && ! is_numeric($target_project_id)) {
23-
throw new InvalidArgumentException('target_project_id should be numeric, the project name is not allowed');
23+
throw new \InvalidArgumentException('target_project_id should be numeric, the project name is not allowed');
2424
}
2525

2626
return $this->post('projects/'.urlencode($project_id).'/merge_requests', array(
2727
'source_branch' => $source,
2828
'target_branch' => $target,
2929
'title' => $title,
3030
'assignee_id' => $assignee,
31-
'target_project_id' => $target_project_id
31+
'target_project_id' => $target_project_id,
32+
'description' => $description
3233
));
3334
}
3435

lib/Gitlab/Model/Project.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ public function mergeRequest($id)
330330
return $mr->show();
331331
}
332332

333-
public function createMergeRequest($source, $target, $title, $assignee = null)
333+
public function createMergeRequest($source, $target, $title, $assignee = null, $description = null)
334334
{
335-
$data = $this->api('mr')->create($this->id, $source, $target, $title, $assignee);
335+
$data = $this->api('mr')->create($this->id, $source, $target, $title, $assignee, null, $description);
336336

337337
return MergeRequest::fromArray($this->getClient(), $this, $data);
338338
}
@@ -494,12 +494,12 @@ public function removeSnippet($id)
494494
return $snippet->remove();
495495
}
496496

497-
public function transfer($group_id)
498-
{
499-
$group = new Group($group_id, $this->getClient());
497+
public function transfer($group_id)
498+
{
499+
$group = new Group($group_id, $this->getClient());
500500

501-
return $group->transfer($this->id);
502-
}
501+
return $group->transfer($this->id);
502+
}
503503

504504
public function forkTo($id)
505505
{

0 commit comments

Comments
 (0)