Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce git_blob_is_binary() #1149

Merged
merged 2 commits into from Dec 17, 2012
Merged

Introduce git_blob_is_binary() #1149

merged 2 commits into from Dec 17, 2012

Conversation

nulltoken
Copy link
Member

Determine if the blob content is most certainly binary or not.

The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 4000 bytes.

@vmg
Copy link
Member

vmg commented Dec 17, 2012

Clean and simple. Love it!

vmg pushed a commit that referenced this pull request Dec 17, 2012
@vmg vmg merged commit 0d10e79 into libgit2:development Dec 17, 2012
phatblat pushed a commit to phatblat/libgit2 that referenced this pull request Sep 13, 2014
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.

None yet

2 participants