From 131e6b0208489806e7494662f24e130a7be71967 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 6 Jul 2020 09:23:03 +0200 Subject: [PATCH] check_format: Mitigate #1455 Make sure that git diff ignores all submodules while looking for changes made by astyle. This should prevent the following issues from occurring: object directory /var/ci_repos/dpdk-submodule.git/objects does not exist; check .git/objects/info/alternates object directory /var/ci_repos/intel-ipsec-mb.git/objects does not exist; check .git/objects/info/alternates error: bad tree object HEAD fatal: 'git status --porcelain=2' failed in submodule intel-ipsec-mb Change-Id: Ie9a39e324674337fdbd6bf627da6e80775ceaeec Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3223 Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Paul Luse Reviewed-by: Ben Walker Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins --- scripts/check_format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 72840f340..b9182c710 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -96,7 +96,7 @@ if hash astyle; then | xargs -P$(nproc) -n10 astyle --options=.astylerc >> astyle.log if grep -q "^Formatted" astyle.log; then echo " errors detected" - git diff + git diff --ignore-submodules=all sed -i -e 's/ / /g' astyle.log grep --color=auto "^Formatted.*" astyle.log echo "Incorrect code style detected in one or more files."