MCPcopy Index your code
hub / github.com/GitGuardian/ggshield / check_git_ref

Function check_git_ref

ggshield/utils/git_shell.py:312–319  ·  view source on GitHub ↗

Check if folder is a git repository and ref is a git reference.

(ref: str, wd: Optional[Union[str, Path]] = None)

Source from the content-addressed store, hash-verified

310
311
312def check_git_ref(ref: str, wd: Optional[Union[str, Path]] = None) -> None:
313 """Check if folder is a git repository and ref is a git reference."""
314 if wd is None:
315 wd = Path.cwd()
316 check_git_dir(wd)
317
318 if not is_valid_git_commit_ref(ref=ref, wd=wd):
319 raise InvalidGitRefError(ref)
320
321
322def get_list_commit_SHA(

Calls 3

check_git_dirFunction · 0.85
is_valid_git_commit_refFunction · 0.85
InvalidGitRefErrorClass · 0.85