9 lines
484 B
Python
9 lines
484 B
Python
def _get_branch(self, branch: Optional[str], __user__: dict = None) -> str:
|
|
"""Get effective branch with priority resolution."""
|
|
if branch:
|
|
return branch
|
|
if __user__ and "valves" in __user__:
|
|
user_valves = __user__.get("valves") if __user__ else None
|
|
if self.valves.ALLOW_USER_OVERRIDES and user_valves.USER_DEFAULT_BRANCH:
|
|
return user_valves.USER_DEFAULT_BRANCH
|
|
return self.valves.DEFAULT_BRANCH |