Skip to content

Commit 08dce8d

Browse files
authored
Bitbucket Server: Add boostMatches query parameter to get_branches (#1214)
* Bitbucket Server: Add boostMatches query parameter to get_branches * Update get_branches doc to add boost_matches parameter
1 parent bad2d28 commit 08dce8d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

atlassian/bitbucket/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ def get_branches(
11541154
limit=None,
11551155
details=True,
11561156
order_by="MODIFICATION",
1157+
boost_matches=False,
11571158
):
11581159
"""
11591160
Retrieve the branches matching the supplied filterText param.
@@ -1167,6 +1168,7 @@ def get_branches(
11671168
fixed system limits. Default by built-in method: None
11681169
:param details: whether to retrieve plugin-provided metadata about each branch
11691170
:param order_by: OPTIONAL: ordering of refs either ALPHABETICAL (by name) or MODIFICATION (last updated)
1171+
:param boost_matches: Controls whether exact and prefix matches will be boosted to the top
11701172
:return:
11711173
"""
11721174
url = self._url_repo_branches(project_key, repository_slug)
@@ -1182,6 +1184,7 @@ def get_branches(
11821184
if order_by:
11831185
params["orderBy"] = order_by
11841186
params["details"] = details
1187+
params["boostMatches"] = boost_matches
11851188
return self._get_paged(url, params=params)
11861189

11871190
def _url_repo_default_branche(self, project_key, repository_slug):

docs/bitbucket.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Manage code
184184
bitbucket.create_repo(project_key, repository, forkable=False, is_private=True)
185185
186186
# Get branches from repo
187-
bitbucket.get_branches(project, repository, filter='', limit=99999, details=True)
187+
bitbucket.get_branches(project, repository, filter='', limit=99999, details=True, boost_matches=False)
188188
189189
# Creates a branch using the information provided in the request.
190190
# The authenticated user must have REPO_WRITE permission for the context repository to call this resource.

0 commit comments

Comments
 (0)