diff --git a/plugins/git4idea/src/git4idea/performanceTesting/GitCommandProvider.java b/plugins/git4idea/src/git4idea/performanceTesting/GitCommandProvider.java index 8643e662dd8d..9de012667280 100644 --- a/plugins/git4idea/src/git4idea/performanceTesting/GitCommandProvider.java +++ b/plugins/git4idea/src/git4idea/performanceTesting/GitCommandProvider.java @@ -20,7 +20,8 @@ public final class GitCommandProvider implements CommandProvider { Map.entry(CheckGitLogIndexedCommand.PREFIX, CheckGitLogIndexedCommand::new), Map.entry(WaitVcsLogIndexingCommand.PREFIX, WaitVcsLogIndexingCommand::new), Map.entry(WaitForVcsLogUpdateCommand.PREFIX, WaitForVcsLogUpdateCommand::new), - Map.entry(GitRollbackCommand.PREFIX, GitRollbackCommand::new) + Map.entry(GitRollbackCommand.PREFIX, GitRollbackCommand::new), + Map.entry(VcsDisableConfirmationPopupCommand.PREFIX, VcsDisableConfirmationPopupCommand::new) ); } } diff --git a/plugins/git4idea/src/git4idea/performanceTesting/VcsDisableConfirmationPopupCommand.kt b/plugins/git4idea/src/git4idea/performanceTesting/VcsDisableConfirmationPopupCommand.kt new file mode 100644 index 000000000000..7375998627ab --- /dev/null +++ b/plugins/git4idea/src/git4idea/performanceTesting/VcsDisableConfirmationPopupCommand.kt @@ -0,0 +1,30 @@ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package git4idea.performanceTesting + +import com.intellij.openapi.ui.playback.PlaybackContext +import com.intellij.openapi.vcs.ProjectLevelVcsManager +import com.intellij.openapi.vcs.VcsConfiguration +import com.intellij.openapi.vcs.VcsShowConfirmationOption +import com.jetbrains.performancePlugin.commands.PerformanceCommandCoroutineAdapter + +internal class VcsDisableConfirmationPopupCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line) { + companion object { + const val NAME = "vcsDisableConfirmationPopup" + const val PREFIX = "$CMD_PREFIX$NAME" + } + + override suspend fun doExecute(context: PlaybackContext) { + val vcsManager = ProjectLevelVcsManager.getInstance(context.project) + val vcss = vcsManager.getAllSupportedVcss() + vcss.forEach { vcs -> + VcsConfiguration.StandardConfirmation.entries.forEach { confirmationType -> + val option = vcsManager.getStandardConfirmation(confirmationType, vcs) + option.setValue(VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY) + } + } + } + + override fun getName(): String { + return NAME + } +} diff --git a/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt b/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt index 75b7c42a2488..1dd6c0453b42 100644 --- a/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt +++ b/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt @@ -1116,6 +1116,10 @@ fun T.gitRollbackFile(pathToFile: String): T = apply { addCommand("${CMD_PREFIX}gitRollbackFile ${pathToFile}") } +fun T.vcsDisableConfirmationPopup(): T = apply { + addCommand("${CMD_PREFIX}vcsDisableConfirmationPopup") +} + fun T.replaceText(startOffset: Int? = null, endOffset: Int? = null, newText: String? = null): T = apply { val options = StringBuilder() if (startOffset != null) {