INNER CODE UNIT · Python
fetch_raw
dotnet/sdk · .github/scripts/check_vendored_files.py:197
def fetch_raw(repo: str, ref: str, path: str) -> str | None:
url = f"{RAW_BASE}/{repo}/{ref}/{urllib.parse.quote(path)}"
status, body, _ = _request(url, accept="text/plain")
if status != 200:
return None
return body.decode("utf-8", errors="replace")
# ---------- drift detection ----------
@dataclass
class DriftResult:
entry: Entry
source_index: int
source: Source
status: str # "drift", "missing", "ref_missing", "ok", "error"
current_blob_sha: str | None
current_ref_sha: str | None