GitHub inserts line endings using CRs in some cases when squashing
commits. This causes issues in case of scripted diffs where the
script is extracted from the commit message by commit-script-check.sh.
This patch fixes this by removing CRs at the end of the line before
extracting the script for checking the commit.
You can test the change locally by calling commit-script-check.sh manually with a commit range which includes a scripted diff. I tested with test/lint/commit-script-check.sh 9978e63..a52d88e which is the commit with the scripted diff we added in #1072.
GitHub inserts line endings using CRs in some cases when squashing commits. This causes issues in case of scripted diffs where the script is extracted from the commit message by
commit-script-check.sh
.This patch fixes this by removing CRs at the end of the line before extracting the script for checking the commit.
This issue made the lint check on https://github.com/dtr-org/unit-e/pull/1083 fail. With this patch the lint check should work again on that PR.
You can test the change locally by calling
commit-script-check.sh
manually with a commit range which includes a scripted diff. I tested withtest/lint/commit-script-check.sh 9978e63..a52d88e
which is the commit with the scripted diff we added in #1072.