# #region GitPackage [C:5] [TYPE Module] [SEMANTICS git, api, package, sync]
# @BRIEF Package root for decomposed git routes. Re-exports all public symbols from submodules.
# @LAYER API
# @RELATION CALLS -> [GitPackage]
# @INVARIANT  git_service and os are module-level attributes for test monkeypatch compatibility.
# @PRE  Git service initialized
# @POST  Git API package exported
# @SIDE_EFFECT  Registers git route submodules
# @DATA_CONTRACT  GitRequest -> GitResponse
#             All route functions are re-exported for direct access via `from src.api.routes import git`.

import os

from src.services.git_service import GitService

from ._deps import MAX_REPOSITORY_STATUS_BATCH
from ._router import router

# -- git_service singleton (canonical instance; tests may monkeypatch git_routes.git_service) --
git_service = GitService()

# -- Config routes --
from ._config_routes import create_git_config, delete_git_config, get_git_configs, test_git_config, update_git_config  # noqa: F401

# -- Environment routes --
from ._environment_routes import get_environments  # noqa: F401

# -- Gitea routes --
from ._gitea_routes import create_gitea_repository, create_remote_repository, delete_gitea_repository, list_gitea_repositories  # noqa: F401
from ._helpers import _resolve_dashboard_id_from_ref, _resolve_dashboard_id_from_ref_async, _resolve_repo_key_from_ref  # noqa: F401 — re-exported for test monkeypatch compatibility

# -- Merge routes --
from ._merge_routes import abort_merge, continue_merge, get_merge_conflicts, get_merge_status, resolve_merge_conflicts  # noqa: F401

# -- Repo lifecycle routes (sync, promote, deploy) --
from ._repo_lifecycle_routes import deploy_dashboard, promote_dashboard, sync_dashboard  # noqa: F401

# -- Repo operations routes (commit, push, pull, status, diff, history, generate-message) --
from ._repo_operations_routes import commit_changes, generate_commit_message, get_history, get_repository_diff, get_repository_status, get_repository_status_batch, pull_changes, push_changes  # noqa: F401

# -- Repo routes (core) --
from ._repo_routes import checkout_branch, create_branch, delete_repository, get_branches, get_repository_binding, init_repository  # noqa: F401

# #endregion GitPackage
