List all branches associated with a repository.
        :return:
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']
1170477
def find_branches(self):
        """"""
        for prefix, name, revision_id in self.find_branches_raw():
            yield Revision(
                branch=name,
                repository=self,
                revision_id=revision_id,
            )
1091727
def list(self, path=None, with_metadata=False, include_partitions=False):
        """"""

        l = {}
        for upstream in [self.alternate, self.upstream]:

            for k, v in upstream.list(path, with_metadata, include_partitions).items():
                upstreams = (l[k]['caches'] if k in l else []) + \
                    v.get('caches', upstream.repo_id)

                l[k] = v
                l[k]['caches'] = upstreams

        return l
1208617
def get_branches(self):
        """"""
        if self.else_branch:
            return [self.then_branch, self.else_branch]
        return [self.then_branch]
1069977
def branches(self):
		
		# get all remote branches
		refs = filter(lambda l: isinstance(l, git.RemoteReference), self.repo.references)
		# filter out HEAD branch
		refs = filter(lambda l: l.name != "origin/HEAD", refs)
		# filter out all branches not starting with 'origin/'
		refs = filter(lambda l: l.name.startswith("origin/"), refs)
		for ref in refs:
			self.refs[ref.name[7:]] = ref

		# remove 'origin/' prefix
		return map(lambda l: l.name[7:], refs)
381353
def all(self):
        
        url = self.bitbucket.url('GET_USER', username=self.bitbucket.username)
        response = self.bitbucket.dispatch('GET', url, auth=self.bitbucket.auth)
        try:
            return (response[0], response[1]['repositories'])
        except TypeError:
            pass
        return response
1261850
def list_repo(self):
        
        req = proto.ListRepoRequest()
        res = self.stub.ListRepo(req, metadata=self.metadata)
        if hasattr(res, 'repo_info'):
            return res.repo_info
        return []
488987
def branch(self):
        
        # return self.sh(['git, 'branch'], shell=False)  # parse for '*'
        cmd = ['git', 'symbolic-ref', '--short', 'HEAD']
        try:
            output = self.sh(cmd, shell=False, ignore_error=True).rstrip()
        except subprocess.CalledProcessError as e:
            log.exception(e)
            return  "#err# %s" % output
            #if e.returncode == 128  # bare repo
        if output.startswith('fatal: ref HEAD is not a symbolic ref'):
            output = '# %s' % output
        return output
1249534
def _repo_list(self, args):
        '''
        
        '''
        repo_metadata = self._get_repo_metadata()
        for repo in repo_metadata:
            self.ui.status(repo)
1196700
def all_branch_orders(h):
    
    #Iterate over all sections, find roots
    roots = []
    for section in h.allsec():
        sref = h.SectionRef(sec=section)
        # has_parent returns a float... cast to bool
        if sref.has_parent() < 0.9:
            roots.append(section)

    # Build list of all sections
    order_list = []
    for r in roots:
        add_pre(h,[],r,order_list,0)
    return order_list
1128429
def branches(self):
        # type: () -> List[str]
        
        if self._branches is None:
            cmd = 'git branch --contains {}'.format(self.sha1)
            out = shell.run(
                cmd,
                capture=True,
                never_pretend=True
            ).stdout.strip()
            self._branches = [x.strip('* \t\n') for x in out.splitlines()]

        return self._branches
205379
def list_repos(self, envs=[], query='/repositories/'):
        
        juicer.utils.Log.log_debug(
                "List Repos In: %s", ", ".join(envs))

        repo_lists = {}
        for env in envs:
            repo_lists[env] = []

        for env in envs:
            _r = self.connectors[env].get(query)
            if _r.status_code == Constants.PULP_GET_OK:
                for repo in juicer.utils.load_json_str(_r.content):
                    if re.match(".*-{0}$".format(env), repo['id']):
                        repo_lists[env].append(repo['display_name'])
            else:
                _r.raise_for_status()
        return repo_lists
191107
def display_available_branches(self):
        """"""

        if not self.repo.remotes:
            remote_branches = False
        else:
            remote_branches = True
        branches = self.get_branches(local=True, remote_branches=remote_branches)

        if not branches:
            click.echo(crayons.red('No branches available'))
            return

        branch_col = len(max([b.name for b in branches], key=len)) + 1

        for branch in branches:

            try:
                branch_is_selected = (branch.name == self.get_current_branch_name())
            except TypeError:
                branch_is_selected = False

            marker = '*' if branch_is_selected else ' '
            color = colored.green if branch_is_selected else colored.yellow
            pub = '(published)' if branch.is_published else '(unpublished)'

            click.echo(columns(
                [colored.red(marker), 2],
                [color(branch.name, bold=True), branch_col],
                [black(pub), 14]
            ))
73619
def list_of_installed(self, repo, name):
        
        all_installed_names = []
        all_installed_packages = find_package("", self.meta.pkg_path)
        for inst in all_installed_packages:
            if repo == "sbo" and inst.endswith("_SBo"):
                name = split_package(inst)[0]
                all_installed_names.append(name)
            else:
                if name:
                    all_installed_names.append(split_package(inst)[0])
                else:
                    all_installed_names.append(inst)
        return all_installed_names
863527
def list_tools(self):
        
        tools = []
        exists, sections = self.sections()
        if exists:
            for section in sections:
                options = {'section': section,
                           'built': None,
                           'version': None,
                           'repo': None,
                           'branch': None,
                           'name': None,
                           'groups': None,
                           'image_name': None}
                for option in list(options.keys()):
                    exists, value = self.option(section, option)
                    if exists:
                        options[option] = value
                if 'core' not in options['groups'] and 'hidden' not in options['groups']:
                    tools.append(options)
        return tools
1035150
def find_branches_raw(self):
        """"""
        listing = self.context.capture('git', 'for-each-ref', '--format=%(refname)\t%(objectname)')
        for line in listing.splitlines():
            match = FOR_EACH_REF_PATTERN.match(line)
            if match and match.group('name') != 'HEAD':
                yield (match.group('prefix'),
                       match.group('name'),
                       match.group('revision_id'))
1278209
def list_branch(self, repo_name):
        
        req = proto.ListBranchRequest(repo=proto.Repo(name=repo_name))
        res = self.stub.ListBranch(req, metadata=self.metadata)
        if hasattr(res, 'branch_info'):
            return res.branch_info
        return []