Skip to content

Commit 22a09e8

Browse files
committed
Support for merging branches in a repository
1 parent 57722a2 commit 22a09e8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,4 +331,25 @@ public function watchers($username, $repository, $page = 1)
331331
'page' => $page
332332
));
333333
}
334+
335+
/**
336+
* Perform a merge
337+
* @link http://developer.github.com/v3/repos/merging/
338+
*
339+
* @param string $username
340+
* @param string $repository
341+
* @param string $base The name of the base branch that the head will be merged into.
342+
* @param string $head The head to merge. This can be a branch name or a commit SHA1.
343+
* @param string $message Commit message to use for the merge commit. If omitted, a default message will be used.
344+
*
345+
* @return array|null
346+
*/
347+
public function merge($username, $repository, $base, $head, $message = null)
348+
{
349+
return $this->post('repos/'.urlencode($username).'/'.urlencode($repository).'/merges', array(
350+
'base' => $base,
351+
'head' => $head,
352+
'commit_message' => $message
353+
));
354+
}
334355
}

0 commit comments

Comments
 (0)