VcsHistorySessionConsumer (@NotNull VcsKey vcsKey, @NotNull FilePath filePath, @NotNull VcsHistorySessionConsumer partner) { // this is what needs to be done to put computed file history in cache // we can not retrieve a session from a partner in any other way VcsCacheableHistorySessionFactory<Serializable, VcsAbstractHistorySession> cacheableFactory = getCacheableFactory(); if (cacheableFactory != null) { return new HistoryPartnerProxy(partner, session -> { if (session == null) return; FilePath correctedPath = cacheableFactory.getUsedFilePath(session); myVcsHistoryCache.putSession(filePath, correctedPath, vcsKey, (VcsAbstractHistorySession)session.copy(), cacheableFactory, true); }); } return partner; }