Don't think you can get filtered response both by message and branch in single api call.
- You can use commits api to get all commits filtered by branch and then you can filter them by message within your application.
GET /projects/:id/repository/commits?ref_name=<your branch name>
Sample response:
[
{
"id": "ed899a2f4b50b4370feeea94676502b42383c746",
"short_id": "ed899a2f4b5",
"title": "Replace sanitize with escape once",
"author_name": "Example User",
"author_email": "user@example.com",
"authored_date": "2012-09-20T11:50:22+03:00",
"committer_name": "Administrator",
"committer_email": "admin@example.com",
"committed_date": "2012-09-20T11:50:22+03:00",
"created_at": "2012-09-20T11:50:22+03:00",
"message": "Replace sanitize with escape once", ----> Message
"parent_ids": [
"6104942438c14ec7bd21c6cd5bd995272b3faff6"
],
"web_url": "https://gitlab.example.com/thedude/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746"
}
]
- Or you can search by the message first and then get the list of refs a commit belongs to using
GET /projects/:id/repository/commits/:sha/refs
This will entail two API calls though, one to get commits filtered by message and then to get list of refs a commit belongs to.
[
{"type": "branch", "name": "'test'"},
{"type": "branch", "name": "add-balsamiq-file"},
{"type": "branch", "name": "wip"},
{"type": "tag", "name": "v1.1.0"}
]