MCPcopy
hub / github.com/tirth8205/code-review-graph / _is_binary

Function _is_binary

code_review_graph/incremental.py:394–400  ·  view source on GitHub ↗

Quick heuristic: check if file appears to be binary.

(path: Path)

Source from the content-addressed store, hash-verified

392
393
394def _is_binary(path: Path) -> bool:
395 """Quick heuristic: check if file appears to be binary."""
396 try:
397 chunk = path.read_bytes()[:8192]
398 return b"\x00" in chunk
399 except (OSError, PermissionError):
400 return True
401
402
403_GIT_TIMEOUT = int(os.environ.get("CRG_GIT_TIMEOUT", "30")) # seconds, configurable

Callers 5

collect_all_filesFunction · 0.85
_update_fileMethod · 0.85

Calls

no outgoing calls