diff --git a/pkg/commands/remotes.go b/pkg/commands/remotes.go index 75dee0b46..b60f3d2a6 100644 --- a/pkg/commands/remotes.go +++ b/pkg/commands/remotes.go @@ -5,23 +5,23 @@ import ( ) func (c *GitCommand) AddRemote(name string, url string) error { - return c.RunCommand("git remote add %s %s", name, url) + return c.RunCommand("git remote add %s %s", c.OSCommand.Quote(name), c.OSCommand.Quote(url)) } func (c *GitCommand) RemoveRemote(name string) error { - return c.RunCommand("git remote remove %s", name) + return c.RunCommand("git remote remove %s", c.OSCommand.Quote(name)) } func (c *GitCommand) RenameRemote(oldRemoteName string, newRemoteName string) error { - return c.RunCommand("git remote rename %s %s", oldRemoteName, newRemoteName) + return c.RunCommand("git remote rename %s %s", c.OSCommand.Quote(oldRemoteName), c.OSCommand.Quote(newRemoteName)) } func (c *GitCommand) UpdateRemoteUrl(remoteName string, updatedUrl string) error { - return c.RunCommand("git remote set-url %s %s", remoteName, updatedUrl) + return c.RunCommand("git remote set-url %s %s", c.OSCommand.Quote(remoteName), c.OSCommand.Quote(updatedUrl)) } func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string, promptUserForCredential func(string) string) error { - command := fmt.Sprintf("git push %s --delete %s", remoteName, branchName) + command := fmt.Sprintf("git push %s --delete %s", c.OSCommand.Quote(remoteName), c.OSCommand.Quote(branchName)) return c.OSCommand.DetectUnamePass(command, promptUserForCredential) }