summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-10-06 23:20:19 +0900
committerRyooooooga <eial5q265e5@gmail.com>2021-10-06 23:20:19 +0900
commite19b4fe369c0ff0947c1980dbc579e88f528fd68 (patch)
tree23cfdfdc8a56047153529bc9689c7970c678e181 /pkg/commands
parenteb7531b206352f8e89d481d311a10828052faa01 (diff)
Fix git-remote commands
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/remotes.go10
1 files 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)
}