MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / _get_git_repo

Function _get_git_repo

codewiki/cli/utils/repo_validator.py:119–133  ·  view source on GitHub ↗

Find a git repository starting at repo_path and searching parent directories. Args: repo_path: Path to start searching from Returns: git.Repo instance or None if no repository found

(repo_path: Path)

Source from the content-addressed store, hash-verified

117
118
119def _get_git_repo(repo_path: Path):
120 """
121 Find a git repository starting at repo_path and searching parent directories.
122
123 Args:
124 repo_path: Path to start searching from
125
126 Returns:
127 git.Repo instance or None if no repository found
128 """
129 try:
130 import git
131 return git.Repo(repo_path, search_parent_directories=True)
132 except Exception:
133 return None
134
135
136def is_git_repository(repo_path: Path) -> bool:

Callers 3

is_git_repositoryFunction · 0.85
get_git_commit_hashFunction · 0.85
get_git_branchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected