summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-17 14:28:38 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-21 22:07:14 +1100
commitb42202ea1c82d93d828fec38ddfdc073c041dec9 (patch)
treec495aaf3ff26b1f12110a66381918cbde2f9f056 /pkg/commands
parent8347dcd67149e329d3c23c7453a59b12e2d5533d (diff)
better fast forward
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 912483b84..c2e12491d 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -272,12 +272,11 @@ func (c *GitCommand) ResetAndClean() error {
}
func (c *GitCommand) GetCurrentBranchUpstreamDifferenceCount() (string, string) {
- return c.GetCommitDifferences("HEAD", "@{u}")
+ return c.GetCommitDifferences("HEAD", "HEAD@{u}")
}
func (c *GitCommand) GetBranchUpstreamDifferenceCount(branchName string) (string, string) {
- upstream := "origin" // hardcoded for now
- return c.GetCommitDifferences(branchName, fmt.Sprintf("%s/%s", upstream, branchName))
+ return c.GetCommitDifferences(branchName, branchName+"@{u}")
}
// GetCommitDifferences checks how many pushables/pullables there are for the
@@ -643,9 +642,8 @@ func (c *GitCommand) ApplyPatch(patch string, flags ...string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git apply %s %s", flagStr, c.OSCommand.Quote(filepath)))
}
-func (c *GitCommand) FastForward(branchName string) error {
- upstream := "origin" // hardcoding for now
- return c.OSCommand.RunCommand(fmt.Sprintf("git fetch %s %s:%s", upstream, branchName, branchName))
+func (c *GitCommand) FastForward(branchName string, remoteName string, remoteBranchName string) error {
+ return c.OSCommand.RunCommand(fmt.Sprintf("git fetch %s %s:%s", remoteName, remoteBranchName, branchName))
}
func (c *GitCommand) RunSkipEditorCommand(command string) error {