Skip to content

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/Github/Api/PullRequest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,18 @@ public function merged($username, $repository, $id)
115115
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge');
116116
}
117117

118-
public function merge($username, $repository, $id, $message, $sha)
118+
public function merge($username, $repository, $id, $message, $sha, $squash = false, $title = null)
119119
{
120-
return $this->put('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge', array(
121-
'commit_message' => $message, 'sha' => $sha
122-
));
120+
$params = array(
121+
'commit_message' => $message,
122+
'sha' => $sha,
123+
'squash' => $squash,
124+
);
125+
126+
if (is_string($title)) {
127+
$params['commit_title'] = $title;
128+
}
129+
130+
return $this->put('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge', $params);
123131
}
124132
}

0 commit comments

Comments
 (0)