[git-clang-format] Do not apply clang-format to symlinks
authorPirama Arumuga Nainar <pirama@google.com>
Wed, 5 May 2021 00:41:40 +0000 (17:41 -0700)
committerPirama Arumuga Nainar <pirama@google.com>
Tue, 11 May 2021 17:34:40 +0000 (10:34 -0700)
commit0fd0a010a1ed2ce761d20bfc6378e5bbaa75c8de
treee63bca4ec7d59331e23373ca40841f34319ce3c0
parent9ab49ae55dd7b928c2b806adccf6d07a89e59102
[git-clang-format] Do not apply clang-format to symlinks

This fixes PR46992.

Git stores symlinks as text files and we should not format them even if
they have one of the requested extensions.

(Move the call to `cd_to_toplevel()` up a few lines so we can also print
the skipped symlinks during verbose output.)

Differential Revision: https://reviews.llvm.org/D101878
clang/docs/ReleaseNotes.rst
clang/tools/clang-format/git-clang-format