Files
ss-tools/backend/src/api/routes/git/_deps.py
2026-05-13 14:15:33 +03:00

23 lines
905 B
Python

# #region GitDeps [C:1] [TYPE Module] [SEMANTICS git, dependency, service, provider]
# @BRIEF Shared dependency wiring for monkeypatch-safe git_service access and constants.
# @LAYER: API
# @INVARIANT: get_git_service() resolves from sys.modules at call time so test monkeypatching
# of git_routes.git_service (the __init__ attribute) takes effect across all submodules.
import sys
# Batch limit for repository status queries
MAX_REPOSITORY_STATUS_BATCH: int = 50
def get_git_service():
"""Resolve git_service from the git package root at call time.
This indirection ensures that test monkeypatching via
``monkeypatch.setattr(git_routes, 'git_service', mock)``
is visible to every submodule function, because each call
re-resolves ``sys.modules['src.api.routes.git'].git_service``.
"""
return sys.modules["src.api.routes.git"].git_service
# #endregion GitDeps