jesseduffield.lazygit/pkg
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
..
app Bump minimum required git version to 2.32 2025-07-09 12:18:57 +02:00
cheatsheet fix: broken markdown by replace \n into <md> 2025-07-06 10:11:49 +02:00
commands Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Add new command "Checkout previous branch" 2025-07-12 18:17:25 +02:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
gui Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
i18n Add confirmation for nuking the working tree 2025-07-13 14:04:14 +02:00
integration Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
jsonschema Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Enable revive linter, and fix a bunch of warnings 2025-06-30 19:13:20 +02:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Enable revive linter, and fix a bunch of warnings 2025-06-30 19:13:20 +02:00