1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

commands/git : add test to Commit func, refactor

This commit is contained in:
Anthony HAMON
2018-09-10 22:25:02 +02:00
parent d23577168f
commit 415aad600c
2 changed files with 71 additions and 1 deletions

View File

@@ -291,10 +291,11 @@ func (c *GitCommand) usingGpg() bool {
// Commit commits to git
func (c *GitCommand) Commit(message string) (*exec.Cmd, error) {
command := "git commit -m " + c.OSCommand.Quote(message)
command := fmt.Sprintf("git commit -m %s", c.OSCommand.Quote(message))
if c.usingGpg() {
return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command), nil
}
return nil, c.OSCommand.RunCommand(command)
}