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

Function is_git_repository

codewiki/cli/utils/repo_validator.py:136–149  ·  view source on GitHub ↗

Check if path is inside a git repository. Searches parent directories if .git is not directly at repo_path, supporting monorepo subdirectories. Args: repo_path: Path to check Returns: True if inside a git repository, False otherwise

(repo_path: Path)

Source from the content-addressed store, hash-verified

134
135
136def is_git_repository(repo_path: Path) -> bool:
137 """
138 Check if path is inside a git repository.
139
140 Searches parent directories if .git is not directly at repo_path,
141 supporting monorepo subdirectories.
142
143 Args:
144 repo_path: Path to check
145
146 Returns:
147 True if inside a git repository, False otherwise
148 """
149 return _get_git_repo(repo_path) is not None
150
151
152def get_git_commit_hash(repo_path: Path) -> str:

Callers 1

generate_commandFunction · 0.90

Calls 1

_get_git_repoFunction · 0.85

Tested by

no test coverage detected