From 89d313b14dffed7271f41f4e2d68ccfe6b6475ed Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 27 May 2020 20:33:25 +0300 Subject: [PATCH] checkpatch.sh: fix clang-format-diff usage - strip 1 path component - it does not accept file name anymore, only stdin Refs: #1029 --- checkpatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkpatch.sh b/checkpatch.sh index 3ce56b7a..5393799d 100755 --- a/checkpatch.sh +++ b/checkpatch.sh @@ -165,7 +165,7 @@ function clang_style() echo "{ $(sed -e 's/#.*//' -e '/---/d' -e '/\.\.\./d' "$c" | tr $'\n' ,) }" } function clang_format() { clang-format -style="$(clang_style)" "$@"; } -function clang_format_diff() { clang-format-diff -style="$(clang_style)" "$@"; } +function clang_format_diff() { cat "$@" | clang-format-diff -p1 -style="$(clang_style)"; } # for non-bare repo will work function clang_format_git() { git format-patch --stdout "$@" -1 | clang_format_diff; } -- 2.50.1