Skip to content

Bitbucket Server: Add boostMatches query parameter to get_branches #1214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions atlassian/bitbucket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ def get_branches(
limit=None,
details=True,
order_by="MODIFICATION",
boost_matches=False,
):
"""
Retrieve the branches matching the supplied filterText param.
Expand All @@ -1167,6 +1168,7 @@ def get_branches(
fixed system limits. Default by built-in method: None
:param details: whether to retrieve plugin-provided metadata about each branch
:param order_by: OPTIONAL: ordering of refs either ALPHABETICAL (by name) or MODIFICATION (last updated)
:param boost_matches: Controls whether exact and prefix matches will be boosted to the top
:return:
"""
url = self._url_repo_branches(project_key, repository_slug)
Expand All @@ -1182,6 +1184,7 @@ def get_branches(
if order_by:
params["orderBy"] = order_by
params["details"] = details
params["boostMatches"] = boost_matches
return self._get_paged(url, params=params)

def _url_repo_default_branche(self, project_key, repository_slug):
Expand Down
2 changes: 1 addition & 1 deletion docs/bitbucket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Manage code
bitbucket.create_repo(project_key, repository, forkable=False, is_private=True)

# Get branches from repo
bitbucket.get_branches(project, repository, filter='', limit=99999, details=True)
bitbucket.get_branches(project, repository, filter='', limit=99999, details=True, boost_matches=False)

# Creates a branch using the information provided in the request.
# The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
Expand Down