|
|
@@ -1,5 +1,5 @@ |
|
|
|
#!/bin/bash |
|
|
|
# Copyright 2019 Huawei Technologies Co., Ltd |
|
|
|
# Copyright 2019-2020 Huawei Technologies Co., Ltd |
|
|
|
# |
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
# you may not use this file except in compliance with the License. |
|
|
@@ -90,11 +90,9 @@ if [ "X${mode}" == "Xall" ]; then |
|
|
|
find inc -type f -name "*" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true |
|
|
|
elif [ "X${mode}" == "Xchanged" ]; then |
|
|
|
# --diff-filter=ACMRTUXB will ignore deleted files in commit |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only | grep "src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only | grep "inc" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only | grep "^inc\|^src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true |
|
|
|
else # "X${mode}" == "Xlastcommit" |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "inc" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true |
|
|
|
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "^inc\|^src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true |
|
|
|
fi |
|
|
|
|
|
|
|
CHECK_RESULT_FILE=__code_format_check_result__ |
|
|
|