diff --git a/src/git_flow/command/base.py b/src/git_flow/command/base.py index 7eb0a6f..2c988b4 100644 --- a/src/git_flow/command/base.py +++ b/src/git_flow/command/base.py @@ -52,15 +52,14 @@ def ensure_initialized(): ) -def ensure_right_branch(): +def ensure_on_branch(): branch = Git.get_current_branch() if branch == "HEAD": raise GitFlowError("No se encuentra parado sobre una rama.") - elif io_confirm(f"Rama actual: {branch}. ¿Es correcto?"): - return branch - else: - raise GitFlowError("Ejecución cancelada.") + + io_info(f"Rama actual: {branch}") + return branch def get_branch_env_and_type(branch: str) -> tuple[str, str]: diff --git a/src/git_flow/command/commit.py b/src/git_flow/command/commit.py index fbc5e4b..5f7c310 100644 --- a/src/git_flow/command/commit.py +++ b/src/git_flow/command/commit.py @@ -16,7 +16,7 @@ app = typer.Typer() def commit(): """Crea un commit siguiendo el formato de Conventional Commits""" base.ensure_initialized() - branch = base.ensure_right_branch() + branch = base.ensure_on_branch() # Una rama WIP termina squasheando en su rama original, que tampoco puede ser un entorno target_branch = branch.removeprefix(WIP_BRANCH_PREFIX) diff --git a/src/git_flow/command/merge.py b/src/git_flow/command/merge.py index 454d4eb..9c05184 100644 --- a/src/git_flow/command/merge.py +++ b/src/git_flow/command/merge.py @@ -15,7 +15,7 @@ def merge(): """Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado""" base.ensure_initialized() - branch = base.ensure_right_branch() + branch = base.ensure_on_branch() if branch in base.environments: if branch == base.environments[-1]: diff --git a/src/git_flow/command/new.py b/src/git_flow/command/new.py index 0dee72b..d6e94ae 100644 --- a/src/git_flow/command/new.py +++ b/src/git_flow/command/new.py @@ -14,7 +14,7 @@ def new(): """Crea una nueva rama siguiendo Conventional Branches""" base.ensure_initialized() - branch = base.ensure_right_branch() + branch = base.ensure_on_branch() if branch not in base.environments: base.io_warning("La rama actual no corresponde a un entorno configurado.") diff --git a/src/git_flow/command/release.py b/src/git_flow/command/release.py index b0556d4..8c582cd 100644 --- a/src/git_flow/command/release.py +++ b/src/git_flow/command/release.py @@ -12,7 +12,7 @@ def release(): """Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado""" base.ensure_initialized() - branch = base.ensure_right_branch() + branch = base.ensure_on_branch() env, _ = base.get_branch_env_and_type(branch) if env == base.environments[-1]: