Files
coding-agent-gitea/gitea/tools/git_tools.py
T
meeks ae4e2d46ac refactor: replace Any types with specific types and update bad_code.md
- Replace Any with object or specific types across codebase
- Add ReviewRequest dataclass for PR review payloads
- Update bad_code.md: mark 5.1 (Any Type Overuse) as resolved
- Fix summary table with accurate counts and unresolved issues list
2026-07-19 15:35:17 +02:00

16 lines
505 B
Python

from gitea.client import GiteaClient
class GitTools:
"""Tools for Gitea git ref operations."""
def __init__(self, client: GiteaClient) -> None:
self._client = client
def create_branch(self, owner: str, repo: str, ref: str, sha: str) -> str:
try:
self._client.files.create_ref(owner, repo, ref, sha)
return f"Branch '{ref}' created successfully in {owner}/{repo}."
except Exception as e:
return f"Error creating branch: {str(e)}"