index.js
function getCurrentBranch(verbose) {
  return Promise.resolve()
    .then(execCmd.bind(null,
      'git',
      ['symbolic-ref', 'HEAD', '-q'],
      'problem getting current branch',
      verbose
    ))
    .catch(function() {
      return '';
    })
    .then(function(result) {
      return result.replace(new RegExp('^refs\/heads\/'), '');
    });
}
function getCurrentBranch(verbose) {
  return Promise.resolve()
    .then(execCmd.bind(null,
      'git',
      ['symbolic-ref', 'HEAD', '-q'],
      'problem getting current branch',
      verbose
    ))
    .catch(function() {
      return '';
    })
    .then(function(result) {
      return result.replace(new RegExp('^refs\/heads\/'), '');
    });
}
function getCurrentBranch ( verbose ) { return Promise . resolve ( ) . then ( execCmd . bind ( null , 'git' , [ 'symbolic-ref' , 'HEAD' , '-q' ] , 'problem getting current branch' , verbose ) ) . catch ( function ( ) { return '' ; } ) . then ( function ( result ) { return result . replace ( new RegExp ( '^refs\/heads\/' ) , '' ) ; } ) ; }
Returns name of current branch or empty string if detached HEAD
@return {string} - name of current branch
Returns name of current branch or empty string if detached HEAD