Skip to content

fix: scan non-UTF-8 Git diffs without losing text checks - #9

Merged
showxu merged 1 commit into
masterfrom
fix/policy-binary-diff
Oct 6, 2026
Merged

showxu merged 1 commit into
masterfrom
fix/policy-binary-diff

Conversation

@showxu

@showxu showxu commented Oct 6, 2026

Copy link
Copy Markdown
Member

Git can emit malformed UTF-8 fixture bytes as text when a file has no NUL. The source policy previously aborted while decoding those diffs. Decode patch bytes with replacement while retaining strict decoding for Git metadata, so readable added content still receives every policy check.

Validation: 19 tests, generated-workflow consistency and actionlint pass. The real Git fixture covers an invalid byte with clean content and confirms a private path alongside invalid bytes still fails with its line number.

@showxu
showxu merged commit 8f7b235 into master Oct 6, 2026
2 checks passed
@showxu
showxu deleted the fix/policy-binary-diff branch October 6, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant