Skip to content

Commit

Permalink
feat: Context Commits on merge requests
Browse files Browse the repository at this point in the history
methods contextCommits() to list context, and addContextCommits() to append context commits
  • Loading branch information
Cerdic committed Feb 19, 2024
1 parent 93f0181 commit 03ffe7e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Api/MergeRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,30 @@ public function commits($project_id, int $mr_iid)
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.self::encodePath($mr_iid).'/commits'));
}

/**
* @param int|string $project_id
* @param int $mr_iid
*
* @return mixed
*/
public function contextCommits($project_id, int $mr_iid)
{
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.self::encodePath($mr_iid).'/context_commits'));
}

/**
* @param int|string $project_id
* @param int $mr_iid
* @param array $params
*
* @return mixed
*/
public function addContextCommits($project_id, int $mr_iid, array $params)
{
return $this->post($this->getProjectPath($project_id, 'merge_requests/'.self::encodePath($mr_iid).'/context_commits'), $params);
}


/**
* @param int|string $project_id
* @param int $mr_iid
Expand Down

0 comments on commit 03ffe7e

Please sign in to comment.