a8n: Correctly use `git apply` with prefix-less unified diffs
Created by: mrnugget
Related issue: #6625. This fixes the problem for some repositories.
When using -p0
with git apply
a lot of the diffs that previously couldn't be applied can now be applied. (There are still some diffs that can't be applied that I'll investigate next.)
It does this by allowing clients to pass arbitrary arguments to git apply
, since I didn't want to hardcode -p0
and break existing behavior.
To keep things consistent I also removed the manually added a/
and /b
prefixes from the "extended header" line that we inject when constructing the multi-file diffs.