From 0af5102faef0aa4931666f3665b9c67601f1455d Mon Sep 17 00:00:00 2001 From: Jonathan Teran Carballo Date: Sun, 14 Dec 2025 13:25:31 -0300 Subject: [PATCH 1/2] bugfix: capturo interrupion por teclado para no mostrar stack trace --- src/git_flow/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/git_flow/main.py b/src/git_flow/main.py index 0281c81..0dadbce 100755 --- a/src/git_flow/main.py +++ b/src/git_flow/main.py @@ -79,6 +79,9 @@ def main(): command.error(str(e)) except Exception as e: command.error("Ocurrió un error inesperado: " + str(e)) + except KeyboardInterrupt as e: + print() + command.error("Ejecución abortada") return From 0d95a978bfba09a7ed03f129e2bb073b26b181db Mon Sep 17 00:00:00 2001 From: Jonathan Teran Carballo Date: Sun, 14 Dec 2025 13:32:23 -0300 Subject: [PATCH 2/2] bugfix: verificar si la rama grupo trackea una rama remota antes de hacer pull --- src/git_flow/command/release.py | 2 +- src/git_flow/git.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/git_flow/command/release.py b/src/git_flow/command/release.py index cdb7053..2988818 100644 --- a/src/git_flow/command/release.py +++ b/src/git_flow/command/release.py @@ -62,7 +62,7 @@ class ReleaseCommand(Command): else: group = next_env - if has_remote: + if has_remote and Git.get_tracking_branch(group): Git("switch", group).exec(print="Cambiando a la rama objetivo") Git("pull").exec(print="Sincronizando cambios la rama objetivo") Git("switch", "-").exec(print="Volviendo a la rama original") diff --git a/src/git_flow/git.py b/src/git_flow/git.py index 02e9399..55e6fce 100644 --- a/src/git_flow/git.py +++ b/src/git_flow/git.py @@ -1,5 +1,6 @@ import subprocess +from git_flow import GitFlowError from git_flow.io import * @@ -80,6 +81,13 @@ class Git: def is_repository() -> bool: return Git("rev-parse", is_inside_work_tree=True).code() == 0 + @staticmethod + def get_tracking_branch(branch: str) -> str | None: + try: + return Git("rev-parse", branch + "@{upstream}", abbrev_ref=True).firstline() + except subprocess.CalledProcessError: + return None + def __init__(self, subcommand: str, *args: str, **kwargs: str | int | bool | list[str] | None) -> None: self.command = ["git", subcommand]