jesseduffield.lazygit/pkg/commands/models
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
..
author.go Keep track of authors across local commits and branch commits for suggestions 2023-07-22 10:47:04 +10:00
branch.go Add ShortRefName to Ref interface 2024-08-28 18:27:52 +02:00
commit.go Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
commit_file.go Rename Name to Path in File and CommitFile 2025-03-20 12:31:34 +01:00
file.go Better main view display for conflicing files 2025-04-09 10:27:57 +02:00
remote.go Use inline status for fetching remotes 2024-01-26 08:29:04 +01:00
remote_branch.go Add ShortRefName to Ref interface 2024-08-28 18:27:52 +02:00
stash_entry.go Add unambigious refs/ prefix to all stash references 2025-06-15 16:14:59 +02:00
submodule_config.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
tag.go Add IsAnnotated field to models.Tag struct 2025-06-30 16:12:33 +02:00
working_tree_state.go Make WorkingTreeState a struct, and add cherry-picking and reverting states 2025-04-20 15:53:17 +02:00
worktree.go Use fields rather than methods on worktrees 2023-07-30 18:35:24 +10:00