summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-14 11:15:29 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-14 11:16:52 +1000
commit95c7df4c61a31a0940eee4981beda78981c651eb (patch)
treec5a4d5602e3d4e5ebc2efc96c8c84c140532dbb2 /pkg/commands/git.go
parentc0a1f906043132c08c7f43b7e8201c571393082f (diff)
use platform-specific message quoting
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 28c368be2..22d15ebdb 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -104,7 +104,7 @@ func (c *GitCommand) StashDo(index int, method string) (string, error) {
// StashSave save stash
func (c *GitCommand) StashSave(message string) (string, error) {
- output, err := c.OSCommand.RunCommand("git stash save \"" + message + "\"")
+ output, err := c.OSCommand.RunCommand("git stash save " + c.OSCommand.Quote(message))
if err != nil {
return output, err
}
@@ -212,7 +212,7 @@ func (c *GitCommand) GetCommitsToPush() []string {
// RenameCommit renames the topmost commit with the given name
func (c *GitCommand) RenameCommit(name string) (string, error) {
- return c.OSCommand.RunDirectCommand("git commit --allow-empty --amend -m \"" + name + "\"")
+ return c.OSCommand.RunDirectCommand("git commit --allow-empty --amend -m " + c.OSCommand.Quote(name))
}
// Fetch fetch git repo
@@ -265,7 +265,7 @@ func (c *GitCommand) UsingGpg() bool {
// Commit commit to git
func (c *GitCommand) Commit(g *gocui.Gui, message string) (*exec.Cmd, error) {
- command := "git commit -m \"" + message + "\""
+ command := "git commit -m " + c.OSCommand.Quote(message)
if c.UsingGpg() {
return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, command)
}
@@ -287,7 +287,7 @@ func (c *GitCommand) Push(branchName string) (string, error) {
// SquashPreviousTwoCommits squashes a commit down to the one below it
// retaining the message of the higher commit
func (c *GitCommand) SquashPreviousTwoCommits(message string) (string, error) {
- return c.OSCommand.RunDirectCommand("git reset --soft HEAD^ && git commit --amend -m \"" + message + "\"")
+ return c.OSCommand.RunDirectCommand("git reset --soft HEAD^ && git commit --amend -m " + c.OSCommand.Quote(message))
}
// SquashFixupCommit squashes a 'FIXUP' commit into the commit beneath it,