code: 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
docs: Determine the branch name of the working directory of this Repository
  
          Returns:
              str: branch name (``git symbolic-ref --short HEAD``)