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

Detect binary file by NULL byte #219

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Detect binary file by NULL byte #219

merged 2 commits into from
Apr 24, 2024

Conversation

Patrick-Beuks
Copy link
Contributor

First wanted to implement this through the use of git ls-files --eol but this would require you to know the tree, which is not always known.

This comment on stack overflow pointed to the implementation git uses:
https://git.kernel.org/pub/scm/git/git.git/tree/xdiff-interface.c?h=v2.30.0#n187

latest version is unchanged

Closes #218

Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thanks

@@ -19,6 +19,8 @@
*/
class Blob
{
private const FIRST_FEW_BYTES = 8000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a little comment that point to git source code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the comment. Is it clear enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect. Thanks

Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@@ -19,6 +19,8 @@
*/
class Blob
{
private const FIRST_FEW_BYTES = 8000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect. Thanks

@lyrixx lyrixx merged commit 640068c into gitonomy:main Apr 24, 2024
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use git binary assigment
2 participants