Closed afhoffman closed 9 months ago
Ah, when I made the 240948b88 commit I did feel uncomfortable about it and wondered what would break. I was actually a bit surprised that nothing broke (apparently)... Thanks for the very clear bug report, and for bisecting it.
BTW, we have a similar problem in the Files view, but it's a bit harder to reproduce. The only reproduction recipe I could come up with so far is this:
git.autoRefresh
to false to make it more deterministicThis also broke with 240948b, so it's likely the same root cause. I'll look into it.
Here's a proposal for a fix: #3266
Describe the bug When adding a commit file to a custom patch, the bottom part of the right half displays title "Diff" and is empty. The view updates after hitting an arrow key to navigate to another file. Something is not refreshing properly when files are added to the patch builder.
To Reproduce Steps to reproduce the behavior:
Expected behavior Immediately after adding a commit file to the patch builder, the view should update as in the "post-refresh" screenshot below.
Screenshots If applicable, add screenshots to help explain your problem. Pre-refresh:
Post-refresh:
Version info: This happens on current master (05b97c8c), but does not happen on 0.40.2. I'm able to duplicate on macOS, Windows 11, and Ubuntu 22.04 (WSL).
Additional context Doing a git bisect, it looks like this behavior started after 240948b8. This change on my fork (https://github.com/afhoffman/lazygit/commit/d1f1ed0c28e686f24e655aaf4d2837972a8b2517) seems to fix it but I'm not totally sure why that fix works, and it doesn't feel right.