Show current branch points
495453
def branches(directory=None, verbose=False):
    """"""
    config = current_app.extensions['migrate'].migrate.get_config(directory)
    if alembic_version >= (0, 7, 0):
        command.branches(config, verbose=verbose)
    else:
        command.branches(config)
667467
def git_branch(self):
        """"""
        info = self.info
        return 'rpm-{major}.{minor}.x'.format(
            major=info[0], minor=info[1])
186529
public function getCurrentBranch()
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'rev-parse'}($this->getRepositoryPath(), array(
            '--symbolic-full-name',
            '--abbrev-ref',
            'HEAD'
        ));
        $result->assertSuccess(
            sprintf('Cannot retrieve current branch from "%s"', $this->getRepositoryPath())
        );

        return $result->getStdOut();
    }
339168
def call_git_branch():
    """"""
    try:
        with open(devnull, "w") as fnull:
            arguments = [GIT_COMMAND, 'rev-parse', '--abbrev-ref', 'HEAD']
            return check_output(arguments, cwd=CURRENT_DIRECTORY,
                                stderr=fnull).decode("ascii").strip()
    except (OSError, CalledProcessError):
        return None
344465
function isCurrentBranch( branch ) {
      return function() {
        var deferred = Q.defer();

        Q.fcall(command('git symbolic-ref --short -q HEAD', 'Get current branch'))
          .then(function( data ) {
            //console.log('data=',data);
            if ( data && data.trim() === branch ) {
              deferred.resolve(true);
            }
            else {
              throw new Error(format('Error. Branch [%s] is not the current branch. Output:[%s]', branch, data.trim()));
            }
          })
          .catch(function( err ) {
            console.log('err=',err);
            deferred.reject(err);
          });
        return deferred.promise;
      };
    }
1134565
def index_branches(self, branches=None, start=0):
        
        ln = self.online_branches if branches is None else branches
        for i, l in enumerate(ln):
            l._i = start + i
533943
def subtree(self, event, create = False):
        '''
        
        '''
        current = self
        for i in range(self.depth, len(event.indices)):
            if not hasattr(current, 'index'):
                return current
            ind = event.indices[i]
            if create:
                current = current.index.setdefault(ind, EventTree(current, self.branch))
                current.parentIndex = ind
            else:
                current = current.index.get(ind)
                if current is None:
                    return None
        return current
207286
def branch_inlet_outlet(data, commdct, branchname):
    """"""
    objkey = 'Branch'.upper()
    theobjects = data.dt[objkey]
    theobject = [obj for obj in theobjects if obj[1] == branchname]
    theobject = theobject[0]
    inletindex = 6
    outletindex = len(theobject) - 2
    return [theobject[inletindex], theobject[outletindex]]
1308799
def get_branches(path):
    
    code, output = call(path, 'branch', '--list')
    if code > 0:
        return None
    branches = output.split('\n')
    newbr = [None]
    for br in branches:
        if br:
            if br[0] == '*':
                newbr[0] = br[2:]
            else:
                newbr.append(br[2:])
    return newbr
1014635
function getBranchLinkDomains(branchXml, key) {
    const output = [];
    if (branchXml.hasOwnProperty(key)) {
      for (let i = 0; i < branchXml[key].length; i++) {
        const item = branchXml[key][i];
        output.push(item.$.value);
      }
    }
    return output;
  }
504194
def current_column(target=pos)
      if c = string.rindex("\n", target-1)
        return target - c - 1
      end

      target + 1
    end
1136002
function (numberOfCalls, branchDefinition) {
        ["if", "else"].forEach(function (label, index) {
            ++this.count;
            this._testedOrIgnored(numberOfCalls[index], branchDefinition.locations[index]);
        }, this);
    }
1090669
def list_branch(path = Dir.pwd)
      cg = MiniGit::Capturing.new(path)
      res = cg.branch :a => true
      res = res.split("\n")
      # Eventually reorder to make the first element of the array the current branch
      i = res.find_index { |e| e =~ /^\*\s/ }
      res[0], res[i] = res[i], res[0] unless (i.nil? || i.zero?)
      res.each { |e| e.sub!(/^\*?\s+/, '') }
      res
    end
588898
def branches(self):
		
		if self.github.get_rate_limit().rate.limit == 0:
			raise GithubException

		branches = self.repo.get_branches()
		return [x.name for x in branches]
822004
def list_branches(self) -> typing.List[str]:
        
        branches: typing.List[str] = [head.name for head in self.repo.heads]
        LOGGER.debug('branches: %s', branches)
        return branches
1084958
def get_num_branches(self):
        
        num = {}
        for trt, branches in itertools.groupby(
                self.branches, operator.attrgetter('trt')):
            num[trt] = sum(1 for br in branches if br.effective)
        return num
823258
def branches(self):
		
		# TODO(jchaloup): find out of all branches are listed (even remote)
		# if there is a concept of remote branch
		return map(lambda (b, r, n): b, self.repo.branches())