MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / is_git_ignored

Function is_git_ignored

scripts/update_license_headers.py:146–157  ·  view source on GitHub ↗

Return True if Git ignore rules exclude a path.

(root: Path, rel: Path)

Source from the content-addressed store, hash-verified

144
145
146def is_git_ignored(root: Path, rel: Path) -> bool:
147 """Return True if Git ignore rules exclude a path."""
148 try:
149 result = subprocess.run(
150 ["git", "-C", str(root), "check-ignore", "-q", "--", str(rel)],
151 check=False,
152 stdout=subprocess.DEVNULL,
153 stderr=subprocess.DEVNULL,
154 )
155 except OSError:
156 return False
157 return result.returncode == 0
158
159
160def is_dockerfile(path: Path) -> bool:

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected