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

Change hashing to ignore line feed differences between windows and linux #287

Merged
merged 2 commits into from
Nov 28, 2021

Conversation

Omegaice
Copy link
Contributor

This change adds file contents probing to try and guess if a file contains text. If it does, then it opens the file and reads the lines from it instead of opening a binary stream to the file.

The main downside to this change I can see is that it reads the text file into memory and then creates an InputStream over the bytes of the string, which are then read into a buffer to calculate the hash. There may be a cleaner way of implementing this to reduce that memory overhead.

It should fix #286.

@rheimus
Copy link
Collaborator

rheimus commented Nov 28, 2021

Can worry about optimizing if it becomes a problem later on. 👍

@rheimus rheimus merged commit 509ce1f into superzanti:master Nov 28, 2021
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.

Unnecessary synchronization of files due to line feed encoding differences
2 participants