File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ func (b *Branch) IsBehindForPull() bool {
103
103
return b .RemoteBranchStoredLocally () && b .BehindForPull != "0"
104
104
}
105
105
106
+ func (b * Branch ) IsBehindForPush () bool {
107
+ return b .BehindForPush != "" && b .BehindForPush != "0"
108
+ }
109
+
106
110
// for when we're in a detached head state
107
111
func (b * Branch ) IsRealBranch () bool {
108
112
return b .AheadForPull != "" && b .BehindForPull != ""
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ func (self *SyncController) push(currentBranch *models.Branch) error {
90
90
// if we are behind our upstream branch we'll ask if the user wants to force push
91
91
if currentBranch .IsTrackingRemote () {
92
92
opts := pushOpts {}
93
- if currentBranch .IsBehindForPull () {
93
+ if currentBranch .IsBehindForPush () {
94
94
return self .requestToForcePush (currentBranch , opts )
95
95
} else {
96
96
return self .pushAux (currentBranch , opts )
Original file line number Diff line number Diff line change @@ -36,12 +36,6 @@ var ForcePushTriangular = NewIntegrationTest(NewIntegrationTestArgs{
36
36
37
37
t .Views ().Files ().IsFocused ().Press (keys .Universal .Push )
38
38
39
- // This results in an attempt to push normally, which fails with an error:
40
- t .ExpectPopup ().Alert ().
41
- Title (Equals ("Error" )).
42
- Content (Contains ("Updates were rejected. Please fetch and examine the remote changes before pushing again." ))
43
-
44
- /* EXPECTED:
45
39
t .ExpectPopup ().Confirmation ().
46
40
Title (Equals ("Force push" )).
47
41
Content (Equals ("Your branch has diverged from the remote branch. Press <esc> to cancel, or <enter> to force push." )).
@@ -67,6 +61,5 @@ var ForcePushTriangular = NewIntegrationTest(NewIntegrationTestArgs{
67
61
68
62
t .Views ().SubCommits ().IsFocused ().
69
63
Lines (Contains ("one" ))
70
- */
71
64
},
72
65
})
You can’t perform that action at this time.
0 commit comments