mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-05 15:15:49 +02:00
There's no reason to have two different ways of applying patches for whole-file patches and partial patches; use --reverse for both. Not only does this simplify the code a bit, but it fixes an actual problem: when reverseOnGenerate and keepOriginalHeader are both true, the generated patch header is broken (the two blobs in the line `index 6d1959b..6dc5f84 100644` are swapped). Git fails to do a proper three-way merge in that case, as it expects the first of the two blobs to be the common ancestor. It would be possible to fix this by extending ModifiedPatchForLines to swap the two blobs in this case; but this would prevent us from concatenating all patches and apply them in one go, which we are going to do later in the branch.