ae4e2d46ac
- 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
16 lines
505 B
Python
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)}"
|