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

Fix FileTestCase.testFiles on windows with core.autocrlf input #25544

Merged
merged 1 commit into from
May 13, 2022

Conversation

Postremus
Copy link
Member

File size is dependent on how the project was checked out. When git is set up with core.autocrlf input, the checkout keeps the line endings as they are commited to the repository (as LF).

On windows, the default System line seperator however is CTRLF.
Previosly, CTRLF was used to replace LF, since the assumption was that the checkout matches the System line seperator.
This is not true however if anything other than the default was choosen for core.autocrlf. On windows, this is quite easy to achieve, since git for windows even has a dialog in the installation wizard for this setting.

This commit now changes the test to simply always read the file from the FS, instead of keeping a copy of the files content as a static variable. This solution is now agnostic to line seperators.

File size is dependent on how the project was checked out. When git is set up with core.autocrlf input, the checkout keeps the line endings as they are commited to the repository (as LF).

On windows, the default System line seperator however is CTRLF.
Previosly, CTRLF was used to replace LF, since the assumption was that the checkout matches the System line seperator.
This is not true however if anything other than the default was choosen for core.autocrlf. On windows, this is quite easy to achieve, since git for windows even has a dialog in the installation wizard for this setting.

This commit now changes the test to simply always read the file from the FS, instead of keeping a copy of the files content as a static variable. This solution is now agnostic to line seperators.
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Thanks!

@geoand geoand merged commit c34043b into quarkusio:main May 13, 2022
@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone May 13, 2022
@Postremus Postremus deleted the fix-windows-filetestcase-testfiles branch May 13, 2022 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants