code: def _get_ref_info_helper(cls, repo, ref_path):
          
          tokens = None
          repodir = _git_dir(repo, ref_path)
          try:
              with open(osp.join(repodir, ref_path), 'rt') as fp:
                  value = fp.read().rstrip()
              # Don't only split on spaces, but on whitespace, which allows to parse lines like
              # 60b64ef992065e2600bfef6187a97f92398a9144                branch 'master' of git-server:/path/to/repo
              tokens = value.split()
              assert(len(tokens) != 0)
          except (OSError, IOError):
              # Probably we are just packed, find our entry in the packed refs file
              # NOTE: We are not a symbolic ref if we are in a packed file, as these
              # are excluded explicitly
              for sha, path in cls._iter_packed_refs(repo):
                  if path != ref_path:
                      continue
                  # sha will be used
                  tokens = sha, path
                  break
              # END for each packed ref
          # END handle packed refs
          if tokens is None:
              raise ValueError("Reference at %r does not exist" % ref_path)
  
          # is it a reference ?
          if tokens[0] == 'ref:':
              return (None, tokens[1])
  
          # its a commit
          if repo.re_hexsha_only.match(tokens[0]):
              return (tokens[0], None)
  
          raise ValueError("Failed to parse reference information from %r" % ref_path)
docs: Return: (str(sha), str(target_ref_path)) if available, the sha the file at
          rela_path points to, or None. target_ref_path is the reference we
          point to, or None