From c4e5995cb94070fd9a736ac9afb5ec7a6cf52c49 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 12 Sep 2024 19:16:40 +0200 Subject: [PATCH] Fix bug with deleting remote branch whose name doesn't match local branch --- pkg/gui/controllers/branches_controller.go | 2 +- .../branch/delete_remote_branch_with_different_name.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go index 0ed0456ae..c7cba1302 100644 --- a/pkg/gui/controllers/branches_controller.go +++ b/pkg/gui/controllers/branches_controller.go @@ -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 { diff --git a/pkg/integration/tests/branch/delete_remote_branch_with_different_name.go b/pkg/integration/tests/branch/delete_remote_branch_with_different_name.go index cd9183b2a..91f4ede27 100644 --- a/pkg/integration/tests/branch/delete_remote_branch_with_different_name.go +++ b/pkg/integration/tests/branch/delete_remote_branch_with_different_name.go @@ -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(), ) }, })