mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-15 11:56:37 +02:00
Break git.merging.args config into separate arguments on whitespace
This makes it possible again to pass multiple arguments, for example "--ff-only --autostash". This won't work correctly if you want to use an argument that contains a space, but it's very unlikely that people will want to do that, so I think this is good enough.
This commit is contained in:
parent
aa81c456bb
commit
253a0096f9
@ -210,7 +210,7 @@ type MergeOpts struct {
|
|||||||
func (self *BranchCommands) Merge(branchName string, opts MergeOpts) error {
|
func (self *BranchCommands) Merge(branchName string, opts MergeOpts) error {
|
||||||
cmdArgs := NewGitCmd("merge").
|
cmdArgs := NewGitCmd("merge").
|
||||||
Arg("--no-edit").
|
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").
|
ArgIf(opts.FastForwardOnly, "--ff-only").
|
||||||
Arg(branchName).
|
Arg(branchName).
|
||||||
ToArgv()
|
ToArgv()
|
||||||
|
@ -138,8 +138,7 @@ func TestBranchMerge(t *testing.T) {
|
|||||||
},
|
},
|
||||||
opts: MergeOpts{},
|
opts: MergeOpts{},
|
||||||
branchName: "mybranch",
|
branchName: "mybranch",
|
||||||
expected: []string{"merge", "--no-edit", "--arg1 --arg2", "mybranch"},
|
expected: []string{"merge", "--no-edit", "--arg1", "--arg2", "mybranch"},
|
||||||
// This is wrong, we want separate arguments for "--arg1" and "--arg2"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
testName: "fast forward only",
|
testName: "fast forward only",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user