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

Potential fix for handling small files #117

Merged
merged 7 commits into from
Jan 15, 2022
Merged

Conversation

jmurty
Copy link
Collaborator

@jmurty jmurty commented Mar 1, 2021

See #116

The read -rn 8 command doesn't seem to cope with small files, and
does all kinds of strange things when I try running it manually on
latest macOS to test, including:

  • not reading anything at all from files with short first lines
  • reading too much from files with long first lines (more than 8 chars)

Overall the head -c8 approach used everywhere else to do this work
is probably safer, and should work with small files as well.

jmurty added 2 commits March 1, 2021 23:48
The `read -rn 8` command doesn't seem to cope with small files, and
does all kinds of strange things when I try running it manually on
latest macOS to test, including:
- not reading anything at all from files with short first lines
- reading too much from files with long first lines (more than 8 chars)

Overall the `head -c8` approach used everywhere else to do this work
is probably safer, and should work with small files as well.
Copy link
Owner

@elasticdog elasticdog left a comment

Choose a reason for hiding this comment

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

Thanks @jmurty for the fix here and for adding tests. Hopefully the user can confirm the fix, but this approach is good with me 👍

jmurty added 4 commits April 28, 2021 23:15
With this change — especially the use of `printf` instead of `echo`
to write file contents — this test case should actually do some
useful work.
* main:
  Improve command hint to fix secret files not encrypted in index (#120) (#130)
  Remove Ubuntu 16.04 LTS from test matrix (#123)
  Configure default Git branch name for macOS tests in GitHub
  Handle rename of primary branch from "master" to "main"
  Ensure Git index is up-to-date before dirty repo  check #37 (#109)
  Fix incorrect salt when partially staged files are commited (#119)
  Use shorthand for grep options for broader compatibility (#121)
@jmurty jmurty merged commit 334697a into main Jan 15, 2022
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.

2 participants