Repository: jesseduffield/lazygit (language: go)

Issue:
Cannot pass multiple args in  git.merging.args config
**Describe the bug**
I'm trying to pass multiple args to the merge command, but I always receive an error.

**To Reproduce**

1. Sets the following in `config.yml`
```yaml
git:
  merging:
    args: "--ff-only --autostash"
```
2. try to merge a branch

**Expected behavior**
The merge happens with the provided args

**Screenshots**
![image](https://github.com/jesseduffield/lazygit/assets/1193756/58da1c95-644d-4c3d-a459-0fdcaddfc5bd)

**Version info:**
commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=darwin, arch=amd64, git version=2.43.0

git version 2.43.0

**Additional context**
In the lazygit command log panel I see `git merge --no-edit "--ff-only --autostash" <branch_name>` while with a single args in config the double quote are not there.



Discussion / hints:
Thanks for reporting, this is a bug that was introduced with 25f8b0337e.

It looks like the fix might be as simple as this:
```diff
diff --git a/pkg/commands/git_commands/branch.go b/pkg/commands/git_commands/branch.go
index b8d562dae..d05738ef3 100644
--- a/pkg/commands/git_commands/branch.go
+++ b/pkg/commands/git_commands/branch.go
@@ -210,7 +210,7 @@ type MergeOpts struct {
 func (self *BranchCommands) Merge(branchName string, opts MergeOpts) error {
 	cmdArgs := NewGitCmd("merge").
 		Arg("--no-edit").
-		ArgIf(self.UserConfig.Git.Merging.Args != "", self.UserConfig.Git.Merging.Args).
+		Arg(strings.Fields(self.UserConfig.Git.Merging.Args)...).
 		ArgIf(opts.FastForwardOnly, "--ff-only").
 		Arg(branchName).
 		ToArgv()
```
This will not work correctly when you try to set an option that includes a space, but hopefully nobody wants to do that.

I don't have time to make a PR right now, are you up for doing that? If so, please add a new test scenario to `TestBranchMerge` (in `branch_test.go`).
Thanks to you for the quick answer.
I'd gladly open a PR, but I never programmed in Go, sorry mate 😞

Fix patch:
diff --git a/pkg/commands/git_commands/branch.go b/pkg/commands/git_commands/branch.go
index b8d562dae9f..d05738ef3ca 100644
--- a/pkg/commands/git_commands/branch.go
+++ b/pkg/commands/git_commands/branch.go
@@ -210,7 +210,7 @@ type MergeOpts struct {
 func (self *BranchCommands) Merge(branchName string, opts MergeOpts) error {
 	cmdArgs := NewGitCmd("merge").
 		Arg("--no-edit").
-		ArgIf(self.UserConfig.Git.Merging.Args != "", self.UserConfig.Git.Merging.Args).
+		Arg(strings.Fields(self.UserConfig.Git.Merging.Args)...).
 		ArgIf(opts.FastForwardOnly, "--ff-only").
 		Arg(branchName).
 		ToArgv()


Test patch:
diff --git a/pkg/commands/git_commands/branch_test.go b/pkg/commands/git_commands/branch_test.go
index b94f700ccac..a6082586c94 100644
--- a/pkg/commands/git_commands/branch_test.go
+++ b/pkg/commands/git_commands/branch_test.go
@@ -127,6 +127,19 @@ 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"},
+		},
 		{
 			testName:   "fast forward only",
 			userConfig: &config.UserConfig{},