[clang-format] Add --staged/--cached option to git-clang-format
authorErik Larsson <karl.erik.larsson@gmail.com>
Sat, 30 Oct 2021 16:23:55 +0000 (17:23 +0100)
committermydeveloperday <mydeveloperday@gmail.com>
Sat, 30 Oct 2021 16:37:58 +0000 (17:37 +0100)
commitbee61aa7b638726c3e0eec017fbd89d79a181434
treed1d7ea3bd8397081de3d195318ef717a534f9926
parent59702494390fc75c43e33018924495df9682ab93
[clang-format] Add --staged/--cached option to git-clang-format

When running git-clang-format in a pre-commit hook it's very useful to be able to tell git-clang-format to only look at the --staged/--cached files and not the working directory.

Note this patch is a rebase/fork from {D41147 } which is a fork of {D15465 }

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, lodato

Differential Revision: https://reviews.llvm.org/D90996

Co-authored-by: Mark Lodato <lodato@google.com>
clang/tools/clang-format/git-clang-format