tools/format-cpp.sh: ignore `.git` directory
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 23 Jan 2024 15:39:37 +0000 (10:39 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jan 2024 04:41:27 +0000 (23:41 -0500)
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 <eeppeliteloop@gmail.com>
Change-Id: I328486a81148fe46221bac8979ab6127ed4e3903
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11707
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
tools/format-cpp.sh

index be9ef74c41a260a7e8dd36ec95d21ea2e9732f3c..c0a9583a163cce8c513379938485a5e542407dc8 100755 (executable)
@@ -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.*' \
This page took 0.024555 seconds and 4 git commands to generate.