summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-02-23 15:27:25 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-03-02 10:22:01 +0100
commitaa81c456bbea40c83d345b98c0bbf0e50e0889b0 (patch)
tree87341905a4bc2072ad580a6589201b819f42dbac
parentee5533f9bf101e2ac313f9c0c41b280fb20d967c (diff)
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.
-rw-r--r--pkg/commands/git_commands/branch_test.go14
1 files changed, 14 insertions, 0 deletions
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
@@ -128,6 +128,20 @@ func TestBranchMerge(t *testing.T) {
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{},
opts: MergeOpts{FastForwardOnly: true},