Clang tool: Auto-detect and recurse into explicit submodules

Clang tools orchestrator scripts (like `run_tool.py`) rely on `git
ls-files` to discover the source files that need to be processed.
Because `git ls-files` does not traverse into git submodules by default,
files inside submodules (like dawn, skia, angle, webrtc, ...) were
completely ignored by the tools.

This patch updates the file discovery logic so that if an explicitly
provided `path_filter` argument points to a git submodule (detected by
the presence of a `.git` directory), the script will run `git ls-files`
specifically inside that submodule. This allows submodules to be
processed seamlessly without adding new CLI flags or unnecessarily
traversing the entire repository.

Change-Id: I6ea6168db5f7ea6f5991592afaec0b52024251af
Bug: 501280389
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7757140
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1619397}
NOKEYCHECK=True
GitOrigin-RevId: 7200caae5983da1c7d4bcb7b77fb66a81b485dfe
1 file changed