Skip to content

Commit

Permalink
Temporarily let end-of-file-fixer break LICENSE-BSD symlink
Browse files Browse the repository at this point in the history
On Windows, when `core.symlinks` is `false` or unset (since it
defaults to `false` on Windows), Git checks out symbolic links as
regular files whose contents are symlinks' target paths. Modifying
those regular files and committing the changes alters the symlink
target in the repository, and when they are checked out as actual
symlinks, the targets are different.

But the `end-of-file-fixer` pre-commit hook automatically adds
newlines to the end of regular files that lack them. It doesn't do
this on actual symlinks, but it does do it to regular files that
stand in for symlinks. This causes it to carry a risk of breaking
symlinks if it is run on Windows and the changes committed, and it
is easy to miss that this will happen because `git diff` output
shows it the same way as other additions of absent newlines.

This deliberately commits the change that end-of-file-fixer makes
to the `LICENSE-BSD` symlink, in order to allow a mitigation beyond
just excluding that symlink (or replacing it with a regular file)
to be tested. This change must be undone, of course.
  • Loading branch information
EliahKagan committed Aug 15, 2024
1 parent 53ec790 commit bdfa280
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fuzzing/LICENSE-BSD

0 comments on commit bdfa280

Please sign in to comment.