list_branches
Retrieve all branch names from a Pagure repository by specifying the project and optional namespace to manage repository structure and workflows.
Instructions
List all branches in a Pagure repository.
Args: project: Project name namespace: Project namespace (default: rpms)
Returns: JSON string with list of branch names
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| namespace | No | rpms |
Implementation Reference
- src/pagure/client.py:144-164 (handler)The actual implementation of the list_branches tool logic in the PagureClient class.
async def list_branches( self, project: str, namespace: str = "rpms", ) -> List[str]: """List repository branches. Args: project: Project name namespace: Project namespace Returns: List of branch names """ response = await self.client.get( f"{self.api_base}/{namespace}/{project}/git/branches", headers=self._get_headers(), ) response.raise_for_status() data = response.json() return data.get("branches", [])