1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-16 09:27:37 +03:00
Files
lazygit/pkg/commands/git_commands
Stefan Haller 0f7f1a56df Fix showing diffs for renamed file when filtering by path
When filtering for a file path we use the --follow option for "git log", so it
will follow renames of the file, which is great. However, if you then selected
one of the commits before a rename, you didn't see a diff, because we would pass
the original filter path to the "git show" call.

To fix this, call git log with the --name-status option when filtering by path,
so that each commit reports which file paths are touched in this commit;
remember these in the commit object, so that we can pass them to the "git show"
call later.

Be careful not to store too many such paths unnecessarily. When filtering by
folder rather than file, all these paths will necessarily be inside the original
filter path, so detect this and don't store them in this case.

There is some unfortunate code duplication between loading commits and loading
reflog commits, which I am too lazy to clean up right now.
2025-07-27 12:05:41 +02:00
..
2024-04-12 08:33:47 +02:00
2024-04-12 08:33:47 +02:00
2025-06-30 16:08:03 +02:00
2023-10-08 18:45:36 +02:00
2025-07-08 16:32:21 +02:00
2025-07-08 16:32:21 +02:00
2025-05-01 15:21:37 +02:00
2025-06-30 16:12:33 +02:00
2024-01-10 09:18:38 +01:00