Skip to content

Support for the effective branching model #88

Closed

Description

@bertoost

Hi there,

Just discovered that the branching-model calls are literally the repository settings. Not the inherited settings, if configured. With the effective-branching-model, this should be fixed.

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branching-model/#api-repositories-workspace-repo-slug-effective-branching-model-get

use Bitbucket\Api\Repositories\Workspaces\AbstractWorkspacesApi;
use Bitbucket\HttpClient\Util\UriBuilder;

class EffectiveBranchingModel extends AbstractWorkspacesApi
{
    public function show(array $params = []): array
    {
        $uri = $this->buildEffectiveBranchingModelUri();

        return $this->get($uri, $params);
    }

    protected function buildEffectiveBranchingModelUri(string ...$parts): string
    {
        return UriBuilder::build('repositories', $this->workspace, $this->repo, 'effective-branching-model', ...$parts);
    }
}

In the workspaces part;

public function effectiveBranchingModel(string $repo): EffectiveBranchingModel
{
    return new EffectiveBranchingModel($this->getClient(), $this->workspace, $repo);
}

Activity

  1. stale commented on Apr 24, 2025

    @stale

    This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.

  2. GrahamCampbell commented on May 6, 2026

    @GrahamCampbell
    Member

    Added in #116.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions