From: Philippe Proulx Date: Tue, 23 Jan 2024 15:39:37 +0000 (-0500) Subject: tools/format-cpp.sh: ignore `.git` directory X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=5eda046c9c907ffed31e8c8dccb3bd6a646784fb 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 --- 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.*' \