List Branches

@link https://developer.github.com/v3/repos/#list-branches
@return array
426789
public function listBranches(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/branches', $this->getOwner(),
            $this->getRepo()));
    }
323653
protected function analyseBranches()
	{
		$this->branches = [];
		foreach ($this->xpath->query('//xsl:apply-templates') as $applyTemplates)
		{
			$query            = 'ancestor::*[namespace-uri() != "' . self::XMLNS_XSL . '"]';
			$this->branches[] = iterator_to_array($this->xpath->query($query, $applyTemplates));
		}

		$this->computeAllowsChildElements();
		$this->computeAllowsText();
		$this->computeBitfields();
		$this->computeFormattingElement();
		$this->computeIsEmpty();
		$this->computeIsTransparent();
		$this->computeIsVoid();
		$this->computePreservesNewLines();
		$this->storeLeafNodes();
	}
424501
public function toArray()
    {
        $remotes = [];

        foreach ($this->remotes as $remote) {
            $remotes[] = $remote->toArray();
        }

        return [
            'branch' => $this->branch,
            'head' => $this->head->toArray(),
            'remotes' => $remotes,
        ];
    }
1041676
def branches(self):
		
		req_message = 'https://api.bitbucket.org/1.0/repositories/' + self.reponame + '/branches'
		response_data = self._bitbucketAPIRequest(req_message)
		return response_data.keys()
1177129
public function listBuckets()
    {
        $buckets = [];

        $response = $this->generateAuthenticatedClient([
            'accountId' => $this->accountId,
        ])->request('POST', '/b2_list_buckets');

        foreach ($response['buckets'] as $bucket) {
            $buckets[] = new Bucket($bucket['bucketId'], $bucket['bucketName'], $bucket['bucketType']);
        }

        return $buckets;
    }
491993
private function get_local_branch() {
		$repo = false;
		if ( isset( $_REQUEST['plugin'] ) ) {
			$repos = Singleton::get_instance( 'Plugin', $this )->get_plugin_configs();
			$repo  = isset( $repos[ $_REQUEST['plugin'] ] ) ? $repos[ $_REQUEST['plugin'] ] : false;
		}
		if ( isset( $_REQUEST['theme'] ) ) {
			$repos = Singleton::get_instance( 'Theme', $this )->get_theme_configs();
			$repo  = isset( $repos[ $_REQUEST['theme'] ] ) ? $repos[ $_REQUEST['theme'] ] : false;
		}
		$current_branch = $repo ?
			Singleton::get_instance( 'Branch', $this )->get_current_branch( $repo ) :
			'master';

		return $current_branch;
	}
979829
public function listComments(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
383145
public function getMapCategoriesByBranch() {
    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $locations = $this->getLocations();
    $data = [];
    foreach ($locations as $location_id => $location_name) {
      $link = $this->getUrlFromOpenyProgramsSearchSettings('get_map_categories_by_branch_path', ['{{ branch_id }}' => $location_id]);
      $data[$location_id] = $this->scrapeCategoryList($link);
    }

    $this->cache->set($cid, $data);
    return $data;
  }
1086571
def get_branches(self, repo_slug=None):
        
        repo_slug = repo_slug or self.repo_slug or ''
        url = self.url('GET_BRANCHES',
                       username=self.username,
                       repo_slug=repo_slug)
        return self.dispatch('GET', url, auth=self.auth)
1176852
def local_branches
      @local_branches ||= begin
        branches = []
        if not git.branches.local.empty?
          branches << git.branches.local.select{ |b| b.current }[0].name
          branches << git.branches.local.select{ |b| not b.current }.map{ |b| b.name }
        end
        branches.flatten
      end
    end
461686
protected function updateCode() : array
    {
        $output = [];
        $returnValue = 0;

        $updateMaster = 'ls'; // dummy

        if ($this->getBranch() !== 'master') {
            $updateMaster = ' git checkout master && git pull && git checkout '.$this->getBranch().' ';
        }

        $commands = [
            'git reset --hard HEAD',
            'git pull',
            $updateMaster,
            'composer install --no-dev',
            'yarn install --production',
        ];

        foreach ($commands as $command) {
            exec('cd '.$this->getBasepath().' && '.$command, $output, $returnValue);
        }

        return [
            'output'      => $output,
            'returnValue' => $returnValue,
        ];
    }
526547
public function getSortedRefs()
    {
        $versions = $this->versions;

        usort($versions, function (version $v1, version $v2) {


            return version::gt($v1, $v2) ? -1 : 1;
        });

        $versions = array_map(function (version $v) {


            return $v->getVersion();
        }, $versions);

        return array_merge($this->branches, $versions);
    }
316055
public function branches()
    {
        $result = $this->execute('list', array('--xml' => true, $this->getUrl() . '/' . $this->basePaths['branches']));

        $logTrunk = $this->log('/', null, 1);
        $logTrunk = reset($logTrunk);

        $branches = array();
        $branches[] = new Reference('trunk', Reference::BRANCH, $logTrunk->getRevision());

        foreach ($result as $fileinfo) {
            $branches[] = new Reference($fileinfo->getFilename(), Reference::BRANCH, $fileinfo->getCommit()->getRevision());
        }

        return $branches;
    }
190072
def project_branches(self):
        
        request_url = "{}git/branches".format(self.create_basic_url())

        return_value = self._call_api(request_url)

        return return_value['branches']
1208617
def get_branches(self):
        """"""
        if self.else_branch:
            return [self.then_branch, self.else_branch]
        return [self.then_branch]
606177
private function branchIds($owner)
    {
        $result = array();
        if (isset($this->index[$owner]))
        {
            $result = $this->index[$owner];
            foreach ($result as $section)
            {
                $result = array_merge($result, $this->branchIds($section));
            }
        }
        return $result;
    }
140022
def branches(self):
        """"""
        result = self.git(self.default + ['branch', '-a', '--no-color'])
        return [l.strip(' *\n') for l in result.split('\n') if l.strip(' *\n')]