diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go index 403c51b4f..3de005a2b 100644 --- a/pkg/gui/controllers/branches_controller.go +++ b/pkg/gui/controllers/branches_controller.go @@ -257,9 +257,12 @@ func (self *BranchesController) viewUpstreamOptions(selectedBranch *models.Branc Key: 'r', } + if !selectedBranch.IsTrackingRemote() { + unsetUpstreamItem.DisabledReason = self.c.Tr.UpstreamNotSetError + } + if !selectedBranch.RemoteBranchStoredLocally() { viewDivergenceItem.DisabledReason = self.c.Tr.UpstreamNotSetError - unsetUpstreamItem.DisabledReason = self.c.Tr.UpstreamNotSetError upstreamResetItem.DisabledReason = self.c.Tr.UpstreamNotSetError upstreamRebaseItem.DisabledReason = self.c.Tr.UpstreamNotSetError } diff --git a/pkg/integration/tests/branch/unset_upstream.go b/pkg/integration/tests/branch/unset_upstream.go index 1d4746fd3..39454d2ac 100644 --- a/pkg/integration/tests/branch/unset_upstream.go +++ b/pkg/integration/tests/branch/unset_upstream.go @@ -51,13 +51,9 @@ var UnsetUpstream = NewIntegrationTest(NewIntegrationTestArgs{ Title(Equals("Upstream options")). Select(Contains("Unset upstream of selected branch")). Confirm() - t.ExpectPopup().Alert(). - Title(Equals("Error")). - Content(Equals("The selected branch has no upstream (or the upstream is not stored locally)")). - Cancel() }). SelectedLines( - Contains("branch_to_remove").Contains("origin branch_to_remove").Contains("upstream gone"), + Contains("branch_to_remove").DoesNotContain("origin branch_to_remove").DoesNotContain("upstream gone"), ) }, })