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

    <tr>
        <th>Summary</th>
        <td>
            clang-format continues to recurse into directories 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>
          synco
      </td>
    </tr>
</table>

<pre>
    Create a directory with a sub-directory. If we add the directory into the ignore list, clang-format will recurse into the sub-directory.

Version: Ubuntu clang-format version 18.1.8 (++20240731024944+3b5b5c1ec4a3-1-exp1-20240731145000.144)

Recreate the directory structure, files, and execute clang-format:
`
mkdir -p level1/level2 && touch foo.c level1/bar.c level1/level2/bang.c && tree && echo 'level1/*' > .clang-format-ignore && shopt -s globstar && clang-format --verbose **/*
`
Result, it correctly ignores the file in level1 (bar.c), however continues to recurse into level2 (bang.c) which is not expected.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02PqzgQ_DXm0gLZBgIcOCQzG2mvI-3ejd0B7zo48geZ_Psnk48J0nsSgsbuaruqq4X3epwRe1IfSP2ZiRgm63p_m6XNBqtu_YdDERAEKO1QButucNVhAgE-DvlrsYC_T3BFEEpBmPAtW8_Brkt6nK1DMNoHwj9AGjGP-cm6swhw1caAQxmdxx_E9gRCPwnd39__ovPazqTcwz9DnEPcllvu28DaghUtEN4SfiD8wCmvaFMyyquuqgg_lEM91JKhrESZsxy_Lyx_JrGqppQWLCV274d_obyLsiXqg4syRIeJ3Ukb9CkQswL8RhkDbu5Iykc1sqP34Py_0g7yCxhc0DDCj2vAgfAd4TsINsoJTtYW8idlEO79945Y1-exkC-oQ3zGKCcLhDcvDOF7whsg5V9QvN8wfzTsgfOTvQTIPYzGDj4I99zYKJ_nC7rB-gTbr89af8v0C300qwl0AGldUtDcHgbxq6xJP9Dzg1nq4Mo0dYJ_wGSvuKADaeeg55gwdmufl3TtXQnCO7hOWk6gPcw2AH5fUAZURab6UnVlJzLsWVPSljZVV2dT31ZcKdkyJhrK6o42TVtR7JpS4a7Emme6T1ZhjNaM1aysC8Ya1tGSYdOVCtmOVBTPQpvCmOVcWDdm2vuIPWNVt-syIwY0fh09zjfe4DwNo-sTLh_i6ElF09z4n0pBB4P9Rvs_q_E0qUa_zh-qpO3vup1FZ_ophItPBk3NO446THEopD0ng5nl-ckvzv6HMhB-XGl5wo8PZkvPfwUAAP__o4Ri-w">