Fix bug with deleting remote branch whose name doesn't match local branch

This commit is contained in:
Stefan Haller 2024-09-12 19:16:40 +02:00
parent be3683ccc8
commit c4e5995cb9
2 changed files with 1 additions and 8 deletions

View file

@ -581,7 +581,7 @@ func (self *BranchesController) localDelete(branch *models.Branch) error {
}
func (self *BranchesController) remoteDelete(branch *models.Branch) error {
return self.c.Helpers().BranchesHelper.ConfirmDeleteRemote(branch.UpstreamRemote, branch.Name)
return self.c.Helpers().BranchesHelper.ConfirmDeleteRemote(branch.UpstreamRemote, branch.UpstreamBranch)
}
func (self *BranchesController) forceDelete(branch *models.Branch) error {

View file

@ -37,20 +37,13 @@ var DeleteRemoteBranchWithDifferentName = NewIntegrationTest(NewIntegrationTestA
Tap(func() {
t.ExpectPopup().
Confirmation().
/* EXPECTED:
Title(Equals("Delete branch 'mybranch-remote'?")).
Content(Equals("Are you sure you want to delete the remote branch 'mybranch-remote' from 'origin'?")).
ACTUAL: */
Title(Equals("Delete branch 'mybranch-local'?")).
Content(Equals("Are you sure you want to delete the remote branch 'mybranch-local' from 'origin'?")).
Confirm()
}).
Lines(
Contains("master"),
/* EXPECTED:
Contains("mybranch-local (upstream gone)").IsSelected(),
ACTUAL: */
Contains("mybranch-local ✓").IsSelected(),
)
},
})