private @NotNull Map<String, String> readBranchRefsFromFiles() {
    try {
      // reading from packed-refs first to overwrite values by values from unpacked refs
      Map<String, String> result = new HashMap<>(readPackedBranches());
      result.putAll(readFromRefsFiles(myRefsHeadsDir, REFS_HEADS_PREFIX, myGitFiles));
      result.putAll(readFromRefsFiles(myRefsRemotesDir, REFS_REMOTES_PREFIX, myGitFiles));
      result.remove(REFS_REMOTES_PREFIX + GitUtil.ORIGIN_HEAD);
      return result;
    }
    catch (Throwable e) {
      logDebugAllRefsFiles(myGitFiles);
      LOG.warn("Error reading refs from files", e);
      return emptyMap();
    }
  }
private @NotNull Map<String, String> readBranchRefsFromFiles()