title: Error when trying to apply git diff, "No valid patches in input"
body: <p>I'm creating a powershell script with the goal of going through several git branches, saving a patch of the working changes, switching to the trunk branch to pull remote commits, then switching back to the working branch and reapplying the working changes.</p>
  <p>Here is the method I am testing specifically:</p>
  <pre><code>git diff &gt; test.patch
  git restore .
  *do main branch operation*
  git apply test.patch
  </code></pre>
  <p>However when I try to apply the patch that I have just created I get an error:</p>
  <blockquote>
  <p>error: No valid patches in input (allow with &quot;--allow-empty&quot;)</p>
  </blockquote>
  <p>Does anyone see what I'm doing wrong here?</p>
  <p>Git version:  2.35.2.windows.1</p>
  <p>Powershell version: 5.1.19041.1320</p>