From 6cd36d56bedfab2bf160972b609a844d84f01049 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Wed, 17 Apr 2024 14:42:12 +0200 Subject: [PATCH] [vcs-log] disable building SmallDataPack in the tests GitOrigin-RevId: 7f2c189f2384071e5f2381c3bb780572bb5bc2bc --- .../com/intellij/vcs/log/data/VcsLogRefresherImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java index 2c533716a3e6..3631666b8be5 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java @@ -1,7 +1,8 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.vcs.log.data; import com.intellij.openapi.Disposable; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; @@ -254,7 +255,7 @@ public class VcsLogRefresherImpl implements VcsLogRefresher, Disposable { return VcsLogProperties.SUPPORTS_INCREMENTAL_REFRESH.getOrDefault(provider); }); - smallDataPack = optimize && supportsIncrementalRefresh && SMALL_DATA_PACK_COMMITS_COUNT > 0 + smallDataPack = optimize && supportsIncrementalRefresh && isSmallDataPackEnabled() ? buildSmallDataPack() : DataPack.EMPTY; if (smallDataPack != DataPack.EMPTY) { @@ -270,6 +271,10 @@ public class VcsLogRefresherImpl implements VcsLogRefresher, Disposable { } } + private static boolean isSmallDataPackEnabled() { + return SMALL_DATA_PACK_COMMITS_COUNT > 0 && !ApplicationManager.getApplication().isUnitTestMode(); + } + private @NotNull Collection getRootsToRefresh(@NotNull List requests) { Collection rootsToRefresh = new ArrayList<>(); for (RefreshRequest request : requests) {