Is LF getting replaced by CRLF using git-bash error ok before Salesforce deployment?
I am getting an error which shows that the file will have its line ending in working directory warning: LF will be replaced by CRLF in force-app.
I know that I need to turn off the warning by choosing the correct behavior. I have tried several ways. But I failed to find any answer. So, my question is, if LF gets replaced by CRLF before Salesforce deployment, is it okay?
LF getting replaced by CRLF using git-bash is not an error. It implies a warning, which shows that the files which will be committed later are different from the saved files. Git always tends to convert LF to CRLF. It is Git’s default behavior. It happens because some editors do not know how to handle the LF. The choice of the line depends on the project, and it must be according to the project to offer a little ease to the developers working on a certain project.
If (checksafe == SAFE_CRLF_WARN) warning(“LF will be replaced by CRLF in %s. This will either have an original line ending);
Else (“LF will be replaced by CRLF);
convert.c#crlf_to_git(), itself called by convert.c#convert_to_git(),
The is called by convert.c#crlf_to_git(), which is called by itself, and then it is called by convert.c#renormalize_buffer(), which is called by merge-recursive.c#blob_unchanged().
Considering this, lf will be replaced by CRLF the next time it touches it only when the mentioned commit is part of a merge process. When calling the method convert_to_git(), the checksafe parameter can decide what can happen if the EOL conversion does not occur properly. It also indicates if the line ending should be normalized or not.