From 0e0af8c3b75570111b366c519714ad632693ddc0 Mon Sep 17 00:00:00 2001 From: Benjamin Milan Date: Wed, 22 Apr 2026 15:57:23 +0100 Subject: [PATCH] gh50 dev branches not pushing --- src/sc/branching/branch.py | 4 ++-- src/sc/branching/commands/push.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sc/branching/branch.py b/src/sc/branching/branch.py index 24f6bf9..8dc0c5c 100644 --- a/src/sc/branching/branch.py +++ b/src/sc/branching/branch.py @@ -41,7 +41,7 @@ class Branch: suffix: str = None def __post_init__(self): - if not self.suffix and not self._is_primary_branch: + if not self.suffix and not self.is_primary_branch(): raise ValueError("Can't create non primary branch with no suffix.") @property @@ -50,5 +50,5 @@ def name(self) -> str: return f"{self.type}/{self.suffix}" return str(self.type) - def _is_primary_branch(self) -> bool: + def is_primary_branch(self) -> bool: return self.type in {BranchType.DEVELOP, BranchType.MASTER} diff --git a/src/sc/branching/commands/push.py b/src/sc/branching/commands/push.py index 5491d5f..af40f45 100644 --- a/src/sc/branching/commands/push.py +++ b/src/sc/branching/commands/push.py @@ -103,7 +103,10 @@ def _can_push_project(self, proj: ProjectElementInterface) -> bool: if not self._local_branch_exists(proj_repo, proj_branch_name): logger.info("Branch doesn't exist in project. Skipping.") return False - if self._remote_contains_commit(proj_repo, proj.remote): + if ( + not self.branch.is_primary_branch() + and self._remote_contains_commit(proj_repo, proj.remote) + ): logger.info("Remote already contains commit. Skipping.") return False return True