Skip to content

Commit 6632c88

Browse files
committed
Merge pull request #379 from Soullivaneuh/patch-2
Add commit_message parameter on Repo::merge only if given
2 parents f77df24 + 3acf131 commit 6632c88

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/Github/Api/Repo.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,16 @@ public function subscribers($username, $repository, $page = 1)
488488
*/
489489
public function merge($username, $repository, $base, $head, $message = null)
490490
{
491-
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', array(
492-
'base' => $base,
493-
'head' => $head,
494-
'commit_message' => $message
495-
));
491+
$parameters = array(
492+
'base' => $base,
493+
'head' => $head,
494+
);
495+
496+
if (is_string($message)) {
497+
$parameters['commit_message'] = $message;
498+
}
499+
500+
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', $parameters);
496501
}
497502

498503
/**

0 commit comments

Comments
 (0)