mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-17 22:32:58 +02:00
Fix unsetting upstream when it doesn't exist
This commit is contained in:
parent
e0fc8fe25b
commit
d145e818d0
@ -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
|
||||
}
|
||||
|
@ -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"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user