pre-commit: fix macosx version when files are deleted

parent 778fbca5
......@@ -22,7 +22,7 @@ function git-clang-format-diffing {
format_diff_options="--style=file"
#only diffing commited files, ignored staged one
$format_diff $format_diff_options --diff $(git --no-pager diff --cached --name-only) > git-clang-format.diff
$format_diff $format_diff_options --diff $(git --no-pager diff --cached --name-status | grep -v '^D' | cut -f2) > git-clang-format.diff
if ! grep -q -E '(no modified files to format|clang-format did not modify any files)' git-clang-format.diff; then
invalid-format-detected "git apply git-clang-format.diff" "clang-format $format_diff_options -i <some_file.c>"
......@@ -39,6 +39,7 @@ function clang-format-diff-diffing {
fi
}
set -e
if which git-clang-format &>/dev/null; then
git-clang-format-diffing $@
elif [ ! -z "$(find /usr/bin/ /usr/local/bin/ /opt/bin/ -name 'clang-format-diff*' -type f 2>/dev/null)" ]; then
......
......@@ -46,3 +46,4 @@ tester/tmp_resolv.conf
tester/belle_sip_tester_crt
tester/CUnitAutomated-Results.xml.tmp-Results.xml
belle-sip-tests.log
git-clang-format.diff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment