MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / __init__

Method __init__

codewiki/cli/git_manager.py:25–43  ·  view source on GitHub ↗

Initialize git manager. Args: repo_path: Path to git repository Raises: RepositoryError: If not a valid git repository

(self, repo_path: Path)

Source from the content-addressed store, hash-verified

23 """
24
25 def __init__(self, repo_path: Path):
26 """
27 Initialize git manager.
28
29 Args:
30 repo_path: Path to git repository
31
32 Raises:
33 RepositoryError: If not a valid git repository
34 """
35 self.repo_path = Path(repo_path).expanduser().resolve()
36
37 try:
38 self.repo = git.Repo(repo_path, search_parent_directories=True)
39 except git.InvalidGitRepositoryError:
40 raise RepositoryError(
41 f"Not a git repository: {repo_path}\n\n"
42 "To initialize a git repository: git init"
43 )
44
45 def check_clean_working_directory(self) -> Tuple[bool, str]:
46 """

Callers

nothing calls this directly

Calls 2

RepositoryErrorClass · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected