Skip to content

Commit

Permalink
Merge pull request #379 from Soullivaneuh/patch-2
Browse files Browse the repository at this point in the history
Add commit_message parameter on Repo::merge only if given
  • Loading branch information
cursedcoder committed May 29, 2016
2 parents f77df24 + 3acf131 commit 6632c88
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,16 @@ public function subscribers($username, $repository, $page = 1)
*/
public function merge($username, $repository, $base, $head, $message = null)
{
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', array(
'base' => $base,
'head' => $head,
'commit_message' => $message
));
$parameters = array(
'base' => $base,
'head' => $head,
);

if (is_string($message)) {
$parameters['commit_message'] = $message;
}

return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', $parameters);
}

/**
Expand Down

0 comments on commit 6632c88

Please sign in to comment.