List<VcsRef> (@NotNull String input, @NotNull VirtualFile root) { int firstSpaceIndex = input.indexOf(' '); if (firstSpaceIndex < 0) { return Collections.emptyList(); } String strHash = input.substring(0, firstSpaceIndex); Hash hash = HashImpl.build(strHash); String refPaths = input.substring(firstSpaceIndex + 2, input.length() - 1); String[] longRefPaths = refPaths.split("(, )|( -> )"); List<VcsRef> refs = new ArrayList<>(); for (String longRefPatch : longRefPaths) { VcsRef ref = createRef(hash, longRefPatch, root); refs.add(ref); } return refs; }