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) {