From ace29b2f48ad87fcc8648936e776e28a8cda9158 Mon Sep 17 00:00:00 2001 From: Cerdic Date: Mon, 19 Feb 2024 16:03:18 +0100 Subject: [PATCH] feat: Context Commits on merge requests methods contextCommits() to list context, and addContextCommits() to append context commits --- src/Api/MergeRequests.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Api/MergeRequests.php b/src/Api/MergeRequests.php index ed3779f6..ea32cac7 100644 --- a/src/Api/MergeRequests.php +++ b/src/Api/MergeRequests.php @@ -415,6 +415,29 @@ 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