MCPcopy Create free account
hub / github.com/hunvreus/devpush / get_git_tree

Method get_git_tree

app/services/github.py:302–330  ·  view source on GitHub ↗

Get git tree for repository (all files/directories). Args: user_access_token: User's GitHub OAuth token repo_id: Repository ID sha: Git reference (branch/tag/commit, default: HEAD) recursive: Get entire tree recursively (default: True)

(
        self,
        user_access_token: str,
        repo_id: int,
        sha: str = "HEAD",
        recursive: bool = True,
    )

Source from the content-addressed store, hash-verified

300 return response.json()
301
302 async def get_git_tree(
303 self,
304 user_access_token: str,
305 repo_id: int,
306 sha: str = "HEAD",
307 recursive: bool = True,
308 ) -> dict:
309 """Get git tree for repository (all files/directories).
310
311 Args:
312 user_access_token: User's GitHub OAuth token
313 repo_id: Repository ID
314 sha: Git reference (branch/tag/commit, default: HEAD)
315 recursive: Get entire tree recursively (default: True)
316
317 Returns:
318 Tree object with array of file paths
319 """
320 url = f"https://api.github.com/repositories/{repo_id}/git/trees/{sha}"
321 if recursive:
322 url += "?recursive=1"
323
324 response = httpx.get(
325 url,
326 headers={"Authorization": f"Bearer {user_access_token}"},
327 timeout=10.0,
328 )
329 response.raise_for_status()
330 return response.json()
331
332 async def get_file_content(
333 self,

Callers 1

detectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected