From 07d4ff960e6a5e616953dcf2e077d007c3a66a4b Mon Sep 17 00:00:00 2001 From: Jonathan Teran Carballo Date: Fri, 17 Jul 2026 22:01:42 -0300 Subject: [PATCH] refactor: use base.io_ methods --- src/git_flow/command/branch.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/git_flow/command/branch.py b/src/git_flow/command/branch.py index ba1e9e3..089831a 100644 --- a/src/git_flow/command/branch.py +++ b/src/git_flow/command/branch.py @@ -3,15 +3,16 @@ from git_flow import ( WIP_BRANCH_PREFIX, GitFlowError, ) -from git_flow.command.base import * +import git_flow.command.base as base from git_flow.git import Git from typing import Annotated import typer +from rich.console import Console BRANCH_FORMAT = "%(refname:short)" app = typer.Typer() - +console = Console() @app.command() def branch( @@ -38,28 +39,28 @@ def branch( ] = False, ): """Lista ramas del repositorio, agrupandolas por entorno objetivo""" - ensure_initialized() + base.ensure_initialized() current_branch = Git.get_current_branch() - if current_branch in environments: + if current_branch in base.environments: current_environment = current_branch else: - current_environment, _ = get_branch_env_and_type(current_branch) + current_environment, _ = base.get_branch_env_and_type(current_branch) if trash: show_branches(TRASH_BRANCH_PREFIX, current_branch) elif wip: show_branches(WIP_BRANCH_PREFIX, current_branch) elif all: - show_envs(environments, current_branch) - show_all_branches(environments, current_branch) + show_envs(base.environments, current_branch) + show_all_branches(base.environments, current_branch) elif environment is None: - show_envs(environments, current_branch) - show_env_branches(current_environment, environments, current_branch) - elif environment in environments: - show_envs(environments, current_branch) - show_env_branches(environment, environments, current_branch) + show_envs(base.environments, current_branch) + show_env_branches(current_environment, base.environments, current_branch) + elif environment in base.environments: + show_envs(base.environments, current_branch) + show_env_branches(environment, base.environments, current_branch) else: raise GitFlowError(f"'{environment}' no es un entorno vĂ¡lido.")