summaryrefslogtreecommitdiffstats
path: root/pkg/commands/commits.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-13 08:16:24 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-10-13 08:21:09 +1100
commitb1dd3c48660edea68169779eb860e244b8992427 (patch)
treebca9891e51e6d920b61e487bac1d577c42822989 /pkg/commands/commits.go
parent624fb8da21c644fe79c9c11848930f8ff4b6dede (diff)
support rebinding confirm/newline keys in editor
Diffstat (limited to 'pkg/commands/commits.go')
-rw-r--r--pkg/commands/commits.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/commands/commits.go b/pkg/commands/commits.go
index 48f0412a2..4d14e1832 100644
--- a/pkg/commands/commits.go
+++ b/pkg/commands/commits.go
@@ -22,7 +22,13 @@ func (c *GitCommand) ResetToCommit(sha string, strength string, options oscomman
// Commit commits to git
func (c *GitCommand) Commit(message string, flags string) (*exec.Cmd, error) {
- command := fmt.Sprintf("git commit %s -m %s", flags, strconv.Quote(message))
+ splitMessage := strings.Split(message, "\n")
+ lineArgs := ""
+ for _, line := range splitMessage {
+ lineArgs += fmt.Sprintf(" -m %s", strconv.Quote(line))
+ }
+
+ command := fmt.Sprintf("git commit %s%s", flags, lineArgs)
if c.usingGpg() {
return c.OSCommand.ShellCommandFromString(command), nil
}