From 19a808642f1dee0ee9a19731023f48eff86a1985 Mon Sep 17 00:00:00 2001 From: Randshot Date: Sat, 30 May 2020 23:00:01 +0200 Subject: [PATCH] fix platform specific quoting when using GPG fixes #620 Signed-off-by: Randshot --- pkg/commands/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index e6a655782..8fa2c78bd 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -448,7 +448,7 @@ func (c *GitCommand) usingGpg() bool { func (c *GitCommand) Commit(message string, flags string) (*exec.Cmd, error) { command := fmt.Sprintf("git commit %s -m %s", flags, c.OSCommand.Quote(message)) if c.usingGpg() { - return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command), nil + return c.OSCommand.ExecutableFromString(fmt.Sprintf("%s %s %s", c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command)), nil } return nil, c.OSCommand.RunCommand(command) @@ -465,7 +465,7 @@ func (c *GitCommand) GetHeadCommitMessage() (string, error) { func (c *GitCommand) AmendHead() (*exec.Cmd, error) { command := "git commit --amend --no-edit --allow-empty" if c.usingGpg() { - return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command), nil + return c.OSCommand.ExecutableFromString(fmt.Sprintf("%s %s %s", c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command)), nil } return nil, c.OSCommand.RunCommand(command)