Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/Gitlab/Api/MergeRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ public function show($project_id, $mr_id)
return $this->get('projects/'.urlencode($project_id).'/merge_request/'.urlencode($mr_id));
}

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

return $this->post('projects/'.urlencode($project_id).'/merge_requests', array(
'source_branch' => $source,
'target_branch' => $target,
'title' => $title,
'assignee_id' => $assignee,
'target_project_id' => $target_project_id
'target_project_id' => $target_project_id,
'description' => $description
));
}

Expand Down
14 changes: 7 additions & 7 deletions lib/Gitlab/Model/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ public function mergeRequest($id)
return $mr->show();
}

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

return MergeRequest::fromArray($this->getClient(), $this, $data);
}
Expand Down Expand Up @@ -494,12 +494,12 @@ public function removeSnippet($id)
return $snippet->remove();
}

public function transfer($group_id)
{
$group = new Group($group_id, $this->getClient());
public function transfer($group_id)
{
$group = new Group($group_id, $this->getClient());

return $group->transfer($this->id);
}
return $group->transfer($this->id);
}

public function forkTo($id)
{
Expand Down