<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/102459>102459</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            git-clang-format clears files listed in .clang-format-ignore
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          martinarendar
      </td>
    </tr>
</table>

<pre>
    When using `git clang-format` with `.clang-format-ignore`, the files listed in `.clang-format-ignore` are beeing cleared.

Example:
A simple `main.cpp` file located under [project root, location of `.clang-format` and `.clang-format-ignore`]/src/main.cpp:

```
#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
```

If I add `src/main.cpp` to `.clang-format-ignore` and run `git clang-format -f --style=file` the contents of `main.cpp` get erased.
If I run `clang-format -i --style=file src/main.cpp` the file is ignored and everything works like it's supposed to.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U91uszoQfBpzswKZNeTngou2-aLTJ-i1wQv41NjINu3p2x-Z0HxpG1WKHNlmZ2a9MzIEPViihtWPrD5lcomj880kfdRWerJK-qx16qN5GcnCErQdgO34oCN0Rtoh752fZGQ7Du86jumuuL3I9WCdJ7bjDJ8gjgS9NhTA6BBJgba_VID0BC1R4uwMSU-qYPzE-MNl_fOfnGZDTGz7Bwg6HSTISWpbdPOcYBIjGNfJxLhYRR5Y_Th79y91EbxzMWlbP9DOgut_aFrFWPVbd_WJ4Tn4juH5yv0pbFt3fPtdtii07cyiCJh40i5ET3Ji4s9tjbYREhzDA8MjsP3j5RwAIESVGMRD55aYMJh4Aob4DxnjUkcvzhvFsGSIn9fXGrLKMHGD5iku3gK_HrL96b7udX3u4RmkWp_kW9c7DtH9OlarwC_2no8g7yHPQ_xIYz2lwa1wI0HnbCQbwzaeW7aBIpCX4WqPVdzG8BVdf0OHO9o3j4IOcNGsVsX0Rv4jjsmM786_Jgu_EujIcB8gLPPsAimIrshUI9RRHGVGTblHUSKKY5WNTS3KqlW94H19JMkJD1IdDntJSnHkdZfpBjlW_MAPpeA7URX1vsVjiyWveVWKvmYVp0lqUxjzNhXOD5kOYaGm5FjVx8zIlkxYs4z4xb-IKd2-SXV5uwyBVTxFMPxFijoaagYd8y9PtgYv_EjtvdlmizfNGOMcksfwzPA86DgubdG5ieE5UW1_-ZY-hue1g8DwvDXx1uD_AQAA__8Qv21h">