mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-14 22:08:10 +03:00
I can't do my usual "add the tests first, with EXPECTED/ACTUAL sections that document the bug" method here, because the tests would hang without the bug being fixed. We need two different tests here: one where a cherry-picked commit simply becomes empty "by itself", because the change is already present on the destination branch (this was only a problem with git versions older than 2.45), and the other where the cherry-pick stops with conflicts, and the user resolves them such that no changes are left, and then continues the cherry-pick. This would still fail even with git 2.45 or later. The fix is the same for both cases though. The tests show that the selection behavior after skipping an empty cherry-picked commit is not ideal, but since that's only a minor cosmetic problem we don't bother fixing it here.