Fix tests and add test scenarios for amend.

This commit is contained in:
Kristijan Husak 2018-10-08 22:19:42 +02:00
parent 190309e5c1
commit 4287f8ae90
3 changed files with 78 additions and 9 deletions

View file

@ -317,9 +317,9 @@ func (c *GitCommand) usingGpg() bool {
func (c *GitCommand) Commit(message string, amend bool) (*exec.Cmd, error) {
amendParam := ""
if amend {
amendParam = "--amend"
amendParam = " --amend"
}
command := fmt.Sprintf("git commit %s -m %s", amendParam, c.OSCommand.Quote(message))
command := fmt.Sprintf("git commit%s -m %s", amendParam, c.OSCommand.Quote(message))
if c.usingGpg() {
return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command), nil
}