From aa81c456bbea40c83d345b98c0bbf0e50e0889b0 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 23 Feb 2024 15:27:25 +0100 Subject: Add a test that demonstrates a bug with multiple args in git.merging.args config We are currently passing the whole string as a single argument, which doesn't work of course. --- pkg/commands/git_commands/branch_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/commands/git_commands/branch_test.go b/pkg/commands/git_commands/branch_test.go index b94f700cc..7dcb7f6d6 100644 --- a/pkg/commands/git_commands/branch_test.go +++ b/pkg/commands/git_commands/branch_test.go @@ -127,6 +127,20 @@ func TestBranchMerge(t *testing.T) { branchName: "mybranch", expected: []string{"merge", "--no-edit", "--merging-args", "mybranch"}, }, + { + testName: "multiple merging args", + userConfig: &config.UserConfig{ + Git: config.GitConfig{ + Merging: config.MergingConfig{ + Args: "--arg1 --arg2", // it's up to the user what they put here + }, + }, + }, + opts: MergeOpts{}, + branchName: "mybranch", + expected: []string{"merge", "--no-edit", "--arg1 --arg2", "mybranch"}, + // This is wrong, we want separate arguments for "--arg1" and "--arg2" + }, { testName: "fast forward only", userConfig: &config.UserConfig{}, -- cgit v1.2.3