Fix clang-format-diff usage

"--style" is invalid:

$ ./checkpatch.sh -r HEAD
usage: clang-format-diff [-h] [-i] [-p NUM] [-regex PATTERN] [-iregex PATTERN]
                         [-sort-includes] [-v] [-style STYLE] [-binary BINARY]
clang-format-diff: error: unrecognized arguments: --style={ Language:... }

(cherry picked from commit 866fbb54570c74f215208b237ddce48fb79d2cd6)
This commit is contained in:
Wataru Ashihara 2020-05-28 00:03:03 +09:00 committed by Azat Khuzhin
parent 0970e25c23
commit b0e9577f36

View File

@ -164,8 +164,8 @@ function clang_style()
local c="${options[cfg]}"
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() { clang-format -style="$(clang_style)" "$@"; }
function clang_format_diff() { clang-format-diff -style="$(clang_style)" "$@"; }
# for non-bare repo will work
function clang_format_git()
{ git format-patch --stdout "$@" -1 | clang_format_diff; }