diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-05-30 16:18:40 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-01 08:12:45 +0200 |
commit | 993d66a8ff5bb76481639d3d9401d2817b7bd551 (patch) | |
tree | bbcd105117307147e7a8c3093241794a220ab547 /pkg | |
parent | ab797fe986e1fd3acedefde4ef286cddc5046b49 (diff) |
Don't force-push if the remote branch is not stored locally
This broke with #3528.
If the remote branch is not stored locally, we only see question marks in the
branch status. In this case we can't tell whether we need to force-push, so it's
best to assume that we don't, and see if the server rejects the push, and react
to that by asking to force push. This second part is also broken right now,
we'll fix this in the next commit.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/models/branch.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/commands/models/branch.go b/pkg/commands/models/branch.go index 25d806fca..5a34ba5e8 100644 --- a/pkg/commands/models/branch.go +++ b/pkg/commands/models/branch.go @@ -104,7 +104,7 @@ func (b *Branch) IsBehindForPull() bool { } func (b *Branch) IsBehindForPush() bool { - return b.BehindForPush != "" && b.BehindForPush != "0" + return b.RemoteBranchStoredLocally() && b.BehindForPush != "0" } // for when we're in a detached head state |