SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Don't mess with Windows line endings (#28274)

Summary:
During some rc releases we have seen the file `gradlew.bat` get diffs from release to release, and sometimes the diff is nothing, except some script messing with the line endings of that file.

According to [this](https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings#example) and my own experiments using `unix2dos` and `dos2unix` to swap the line endings of that file, this change fixes this problem.
We specify all the `.bat` files should have the Windows line endings.

## Changelog

[General] [Fixed] - Specify line endings of `.bat` files for Windows in `.gitattributes`
Pull Request resolved: https://github.com/facebook/react-native/pull/28274

Test Plan:
To assist with the test, you can use `brew install unix2dos`.

- Init a new project or use an existing one.
- Make sure in your `.gitattributes` of the project and of the user (home dir or `.config/git/attributes` don't have anything about `.bat` files, or `* text=auto`.
- Run `unix2dos ./android/gradlew.bat`.
- Check git status.
- Run `dos2unix ./android/gradlew.bat`.
- Check git status.
- You will notice that the changes when swapping around are the whole file changed.

- Using the changes in this PR, and doing the above, the git status will be no changes, as it should be. The line changes stay Windows-style.

Reviewed By: cpojer

Differential Revision: D20369235

Pulled By: TheSavior

fbshipit-source-id: 4bb6e9f46caecd36211834c7dc3f0e2e64272862
P
Pavlos Vinieratos committed
5198978f2a8848ed7ec269930fcdeb33059dc1e0
Parent: db12255
Committed by Facebook Github Bot <[email protected]> on 3/10/2020, 9:11:23 PM