1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-25 00:46:54 +02:00

fix command escaping

This commit is contained in:
Ryooooooga
2021-03-01 23:16:48 +09:00
committed by Jesse Duffield
parent 03b9db5e0a
commit 50e4e9d58d
5 changed files with 47 additions and 32 deletions

View File

@ -3,7 +3,6 @@ package commands
import (
"fmt"
"os/exec"
"strconv"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@ -25,7 +24,7 @@ func (c *GitCommand) Commit(message string, flags string) (*exec.Cmd, error) {
splitMessage := strings.Split(message, "\n")
lineArgs := ""
for _, line := range splitMessage {
lineArgs += fmt.Sprintf(" -m %s", strconv.Quote(line))
lineArgs += fmt.Sprintf(" -m %s", c.OSCommand.Quote(line))
}
command := fmt.Sprintf("git commit %s%s", flags, lineArgs)