Skip to content

"nothing to commit" error when there is LF/CRLF changes #241

@ZeroRin

Description

@ZeroRin

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 to true or input, after running git add the change will be fixed and running git status or git commit after that will give you nothing 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions