Fix scripted diffs with CRs in the commit message #1084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #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.