private Map<String, RepositoryTagEntry> readTagMap(AbstractRepository repository, String sha1) throws IOException { TreeMap<String, RepositoryTagEntry> map = new TreeMap<String, RepositoryTagEntry>(); InputStream is = repository.openBlob(sha1); try { ReadStream in = Vfs.openRead(is); String tag; while ((tag = in.readLine()) != null) { String entrySha1 = in.readLine(); RepositoryTagEntry entry = new RepositoryTagEntry(repository, entrySha1); map.put(tag, entry); } } finally { is.close(); } return Collections.unmodifiableMap(map); }