diff --git a/src/git_flow/git.py b/src/git_flow/git.py index f6137a1..1224106 100644 --- a/src/git_flow/git.py +++ b/src/git_flow/git.py @@ -63,19 +63,13 @@ class Git: @staticmethod def get_first_fork_point(branch: str, env: str): - boundary_commits = list( - filter( - lambda c: c.startswith("-"), # boundary commits - Git( - "rev-list", env + "..." + branch, topo_order=True, boundary=True - ).lines(), - ) - ) + # Lista de commits alcanzables por el entorno (por ejemplo, dev), + env_commits = Git("rev-list", env + "..." + branch, first_parent=True).lines() - if not boundary_commits: + if not env_commits: raise RuntimeError("No se encontro un commit base para realizar el rebase.") - return boundary_commits[-1].removeprefix("-") + return Git("show", env_commits[-1] + "^", patch=False, format="%h").firstline() @staticmethod def _get_references(kind: str):