From 5eda046c9c907ffed31e8c8dccb3bd6a646784fb Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 23 Jan 2024 10:39:37 -0500 Subject: [PATCH] tools/format-cpp.sh: ignore `.git` directory A `.hpp` or `.cpp` file could exist in `.git`, for example in `.git/logs/refs/heads` if the branch name ends with `.hpp` or `.cpp`. Signed-off-by: Philippe Proulx Change-Id: I328486a81148fe46221bac8979ab6127ed4e3903 Reviewed-on: https://review.lttng.org/c/babeltrace/+/11707 Reviewed-by: Simon Marchi Tested-by: jenkins --- tools/format-cpp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/format-cpp.sh b/tools/format-cpp.sh index be9ef74c..c0a9583a 100755 --- a/tools/format-cpp.sh +++ b/tools/format-cpp.sh @@ -44,6 +44,7 @@ format_cpp() { # We want an absolute starting directory because find(1) excludes # files in specific subdirectories. find "$(realpath "$root_dir")" \( -name '*.cpp' -o -name '*.hpp' \) \ + ! -path '*/.git/*' \ ! -path '*/src/cpp-common/vendor/*' \ ! -path '*/src/plugins/ctf/common/metadata/parser.*' \ ! -path '*/src/plugins/ctf/common/metadata/lexer.*' \ -- 2.34.1