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

    <tr>
        <th>Summary</th>
        <td>
            Clang format action picking up diffs from other commits
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            github:workflow
      </td>
    </tr>

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

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

<pre>
    There is at least one instance where the clang format action picked up the diff from a different commit in the same file that wasn't included in the current PR.

This occurred in https://github.com/llvm/llvm-project/pull/73506, with the job also trying to format https://github.com/llvm/llvm-project/commit/7c93452e174dd182c36471bc1e8272f26c0ae6db. I'm guessing this has to do with an out of date merge base, but this should work regardless.

I've saved the branch to my fork at https://github.com/boomanaiden154/llvm-project/tree/indvars-dead-code so that the issue can be reproduced.

Will do some more investigation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk81qKzkQhZ9GvSli1JL7x4teZBIMsxuGwKyrpepuJWrJ6Mcmbz9ITrgkcC9kYzdUSae-0jkYo1kd0cS6v5gQs_c7OjSaXNsdmRCse24wp82H6Wutmb1-n142CgQmAiawhDGBdwTGxYROEdxqOW0EyqJbYfFhxwSokvEOLka9kYZ8qR3aLAsswe-A9ZsCuQTK77tJYFztibgTLMaWOzHBDaNjYihlZbMm_dmncqin__n3wPgz44_335fNRPCqVmvvltIlMvnIxJmJ82rSlueD8jsTZ2uvn38Pl-BfSSUmzpdsLRPnQXa8Z-IJbiZtVfHVz4A2ekjh3bgVkv-E_bHGHbmoqJM8doLa4ah1Owol--PQzqqlUQxiEb3iSL2eD_A3E8MOa6YYq3jh3DCWKbS_D4kOfE7gF9CYCHYKK8GMkQrGnNP9UNx8thpuPrxBoBWDthTjlyUWrWt5iivpij4HdGorWvt7gX6DP1N_99h3_hSImDgbp68Y4oMm1A_Ka4Ky3fLsRdTEmAkUOpgJAl2C11mR_jLpf8bawh_9TrD7YlR3pZjMisV_h0ZPUp_kCRua2oG3kouBn5ptkqPs-dj1YtSq7YVQXdcTHzlyTf1p7BszCS5k20rOOe_46dCS6E9aLscBOzlKzY6cdjT2UNgOPqxNHXga5DjIxuJMNn5E7r4bJh_L0hfrbx-pC1Pdy5zXyI7cmpjir9uSSZamp9-EqnggX2qK4j1SPm0UPsIUmxzs9GNbVoBYzT8O8v8AAAD__5iaZwo">