-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
"nothing to commit" error when there is LF/CRLF changes #241
Comments
I'm sure this bug is annoying, but this seems to be out of scope for this Action to solve. I don't fully understand what you're doing or how exactly you're encountering this issue. I can't seem to reproduce this error on my macOS machine nor do I know how we should write tests for this. I've added a note in the "Limitations & Gotchas" section of the README in 18870f2, to inform others about this bug. If you think this bug affects a lot of people and is worth fixing, please reopen this issue and provide an example project or step by step instructions on how to reproduce this error. |
I created a simple example here This bug would affect people who need to set autocrlf to true in their workflow. In my own case the workflow downloads some files with CRLF from another server and I want to change them to LF. Cannot reopen the issue myself XD |
Thanks @ZeroRin for taking the time to put this example repo together. |
This PR adds a test to confirm, that changes to CRLF are not properly detected and that the message "Working tree clean. Nothing to commit." is displayed. Setting `core.autocrlf` to `true` also has no effect here. refs #241
Thanks again @ZeroRin for providing a reproduction repository. However, after investing 2-3 hours into this I was not able to make it work as you might need it. Setting Feel free to clone the repository, install the test suite with If you find a fix, please open a PR. For now I'm letting this issue rest. |
Not familiar with The test case should use something like this
I tested on my modified version here and the output was as expected (showing failure as I did not edit all assertion properly). |
Another solution I found is to use |
Version of the Action
v4.x.x
Describe the bug
When a file's line break is changed (CRLF->LF or LF->CRLF), running
git status
will result in an untracked modification (which passes the dirty check of this action).However, if
core.autocrlf
is set totrue
orinput
, after runninggit add
the change will be fixed and runninggit status
orgit commit
after that will give younothing to commit, working tree clean
. As a result, the commit step would raise a "nothing to commit" error.In my own case, I fixed the issue by running
_switch_to_branch
and_add_files
before_git_is_dirty
, but I'm not sure whether there will be other subsequences.The text was updated successfully, but these errors were encountered: