diff --git a/spyder/plugins/vcs/plugin.py b/spyder/plugins/vcs/plugin.py index c99671e8ad8..ae6c9e2ea2b 100644 --- a/spyder/plugins/vcs/plugin.py +++ b/spyder/plugins/vcs/plugin.py @@ -347,18 +347,3 @@ def _create_actions(self): shortcut_context=self.NAME, triggered=lambda: None, ) - - # workarounds when imported as 3rd party plugin - register_plugin = register - - DESCRIPTION = get_description(None) - - @property - def dockwidget(self): - dockwidget = self.get_widget().dockwidget - if dockwidget is None: - self.is_compatible, _ = self.check_compatibility() - self.get_main().add_dockwidget(self) - dockwidget = self.get_widget().dockwidget - - return dockwidget diff --git a/spyder/plugins/vcs/widgets/common.py b/spyder/plugins/vcs/widgets/common.py index 35efd0308c1..3966349f505 100644 --- a/spyder/plugins/vcs/widgets/common.py +++ b/spyder/plugins/vcs/widgets/common.py @@ -79,6 +79,7 @@ def refresh(self) -> None: """Clear and re-add branches.""" def _task(): """Task executed in another thread.""" + branches = [] if manager.type.branch.fget.enabled: current_branch = manager.branch else: @@ -86,17 +87,18 @@ def _task(): if manager.type.editable_branches.fget.enabled: try: - self._branches.extend(manager.editable_branches) + branches.extend(manager.editable_branches) except VCSPropertyError: # Suppress editable_branches fail pass elif current_branch is not None: - self._branches.append(manager.branch) - return current_branch + branches.append(manager.branch) + return (current_branch, branches) @Slot(object) - def _handle_result(current_branch): - if self._branches: + def _handle_result(result): + if any(result): + current_branch, self._branches = result # Block signals to reduce useless signal emissions oldstate = self.blockSignals(True)