From f1b59e811d02fbcab7c9c22268ca72da3cddcc57 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Tue, 28 Nov 2023 22:23:26 +0100 Subject: [PATCH] [vcs-log] fix working with escaped or quoted spaces when splitting a command line into a list of parameters GitOrigin-RevId: 43de4d4f4ef309e73d738b385ca2a66ea48e546d --- .../git4idea/src/git4idea/log/command/GitLogCommandFilterer.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/log/command/GitLogCommandFilterer.kt b/plugins/git4idea/src/git4idea/log/command/GitLogCommandFilterer.kt index 2f4a55699532..f59c7bf5c386 100644 --- a/plugins/git4idea/src/git4idea/log/command/GitLogCommandFilterer.kt +++ b/plugins/git4idea/src/git4idea/log/command/GitLogCommandFilterer.kt @@ -3,6 +3,7 @@ package git4idea.log.command import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile +import com.intellij.util.execution.ParametersListUtil import com.intellij.vcs.log.VcsLogFilterCollection import com.intellij.vcs.log.data.DataPack import com.intellij.vcs.log.data.VcsLogStorage @@ -54,7 +55,7 @@ class GitLogCommandFilterer(private val project: Project, } private fun prepareCommand(commandFilter: GitLogCommandFilter, commitCount: CommitCountStage): List { - val command = commandFilter.command.split(" ").toMutableList() + val command = ParametersListUtil.parse(commandFilter.command, false, true).toMutableList() command.removeIf { it.startsWith("--pretty") } if (!commitCount.isAll() && !commandFilter.hasMaxCount()) { command.add(0, "$MAX_COUNT${commitCount.count}")