From e19b4fe369c0ff0947c1980dbc579e88f528fd68 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Wed, 6 Oct 2021 23:20:19 +0900 Subject: [PATCH] Fix git-remote commands --- pkg/commands/remotes.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) }