diff --git a/pkg/commands/git_commands/remote.go b/pkg/commands/git_commands/remote.go index ca3610679..650a91c81 100644 --- a/pkg/commands/git_commands/remote.go +++ b/pkg/commands/git_commands/remote.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/jesseduffield/gocui" + "github.com/samber/lo" ) type RemoteCommands struct { @@ -52,7 +53,7 @@ func (self *RemoteCommands) UpdateRemoteUrl(remoteName string, updatedUrl string func (self *RemoteCommands) DeleteRemoteBranch(task gocui.Task, remoteName string, branchNames []string) error { cmdArgs := NewGitCmd("push"). Arg(remoteName, "--delete"). - Arg(branchNames...). + Arg(lo.Map(branchNames, func(b string, _ int) string { return "refs/heads/" + b })...). ToArgv() return self.cmd.New(cmdArgs).PromptOnCredentialRequest(task).Run() diff --git a/pkg/integration/tests/branch/delete_remote_branch_when_tag_with_same_name_exists.go b/pkg/integration/tests/branch/delete_remote_branch_when_tag_with_same_name_exists.go index 5f4171f7d..3255fac53 100644 --- a/pkg/integration/tests/branch/delete_remote_branch_when_tag_with_same_name_exists.go +++ b/pkg/integration/tests/branch/delete_remote_branch_when_tag_with_same_name_exists.go @@ -40,15 +40,9 @@ var DeleteRemoteBranchWhenTagWithSameNameExists = NewIntegrationTest(NewIntegrat Content(Equals("Are you sure you want to delete the remote branch 'xyz' from 'origin'?")). Confirm() - /* EXPECTED: t.Views().RemoteBranches(). Lines( Contains("master").IsSelected(), ) - ACTUAL: */ - t.ExpectPopup().Alert(). - Title(Equals("Error")). - Content(Contains("error: dst refspec xyz matches more than one")). - Confirm() }, })