From 3049da74f62dc6a4a1b8ac44763c3e3e6459fc72 Mon Sep 17 00:00:00 2001 From: Cornelius Schumacher Date: Wed, 8 May 2019 16:26:41 +0200 Subject: [PATCH] Fix scripted diffs with CRs in the commit message 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. Signed-off-by: Cornelius Schumacher --- test/lint/commit-script-check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lint/commit-script-check.sh b/test/lint/commit-script-check.sh index cfe310bee0..04bc2f82e3 100755 --- a/test/lint/commit-script-check.sh +++ b/test/lint/commit-script-check.sh @@ -23,7 +23,7 @@ PREV_HEAD=`git rev-parse HEAD` for i in `git rev-list --reverse $1`; do if git rev-list -n 1 --pretty="%s" $i | grep -q "^scripted-diff:"; then git checkout --quiet $i^ || exit - SCRIPT="`git rev-list --format=%b -n1 $i | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d'`" + SCRIPT="`git rev-list --format=%b -n1 $i | sed 's/\r$//;/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d'`" if test "x$SCRIPT" = "x"; then echo "Error: missing script for: $i" echo "Failed"