support setting upstream

This commit is contained in:
Jesse Duffield 2019-11-17 14:50:12 +11:00
parent b42202ea1c
commit 07cbae4019
6 changed files with 55 additions and 5 deletions

View file

@ -1087,3 +1087,7 @@ func (c *GitCommand) IsHeadDetached() bool {
func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git push %s --delete %s", remoteName, branchName))
}
func (c *GitCommand) SetBranchUpstream(remoteName string, remoteBranchName string, branchName string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git branch --set-upstream-to=%s/%s %s", remoteName, remoteBranchName, branchName))
}