diff options
Diffstat (limited to 'pkg/commands/remotes.go')
-rw-r--r-- | pkg/commands/remotes.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/commands/remotes.go b/pkg/commands/remotes.go index 11e5dc26f..553f222ad 100644 --- a/pkg/commands/remotes.go +++ b/pkg/commands/remotes.go @@ -7,24 +7,24 @@ import ( ) func (c *GitCommand) AddRemote(name string, url string) error { - return c.RunCommand("git remote add %s %s", c.OSCommand.Quote(name), c.OSCommand.Quote(url)) + return c.Run(c.NewCmdObj(fmt.Sprintf("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", c.OSCommand.Quote(name)) + return c.Run(c.NewCmdObj(fmt.Sprintf("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", c.OSCommand.Quote(oldRemoteName), c.OSCommand.Quote(newRemoteName)) + return c.Run(c.NewCmdObj(fmt.Sprintf("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", c.OSCommand.Quote(remoteName), c.OSCommand.Quote(updatedUrl)) + return c.Run(c.NewCmdObj(fmt.Sprintf("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", c.OSCommand.Quote(remoteName), c.OSCommand.Quote(branchName)) - cmdObj := c.NewCmdObjFromStr(command) + cmdObj := c.NewCmdObj(command) return c.DetectUnamePass(cmdObj, promptUserForCredential) } @@ -34,10 +34,10 @@ func (c *GitCommand) DetectUnamePass(cmdObj oscommands.ICmdObj, promptUserForCre // CheckRemoteBranchExists Returns remote branch func (c *GitCommand) CheckRemoteBranchExists(branchName string) bool { - _, err := c.OSCommand.RunCommandWithOutput( - "git show-ref --verify -- refs/remotes/origin/%s", - c.OSCommand.Quote(branchName), - ) + _, err := c.RunWithOutput(c.NewCmdObj( + fmt.Sprintf("git show-ref --verify -- refs/remotes/origin/%s", + c.OSCommand.Quote(branchName), + ))) return err == nil } |