diff options
Diffstat (limited to 'checkpatch.sh')
-rwxr-xr-x | checkpatch.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/checkpatch.sh b/checkpatch.sh index 6eaa19c4..5393799d 100755 --- a/checkpatch.sh +++ b/checkpatch.sh @@ -35,7 +35,7 @@ Example: OPTS: -p - treat as patch -f - treat as regular file - -f - treat as regular file and print diff + -d - treat as regular file and print diff -r - treat as git revision (default) -C - check using clang-format (default) -U - check with uncrustify @@ -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() { 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; } |