Description
Hi all,
While running git clang-format
I have come to a scenario where the script doesn't work as expected.
How to reproduce
- Have staged changes in file
A
which require reformatting - Have staged changes in file
B
which don’t require reformatting - Have unstaged changes in file
B
which are actual changes (let’s say new function) - Run
git clang-format --staged
The effect:
- Unstaged changes in
A
which is the format change. - New changes in file
B
are deleted. <- this is the wrong behavior
Additional info
- The version of the
clang-format
and the script is 16.0.6 - I am running this on MacOs
If the changes that need formatting are staged in B
and anything else is not staged in B
then the git-clang-format
refuses to format and prints a message saying that there are unstaged changes.
Metadata
Metadata
Assignees
Type
Projects
Status
Done