1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

support drilling down into the files of a diff

This commit is contained in:
Jesse Duffield
2020-08-22 13:03:20 +10:00
parent 438abd6003
commit e290710f67
3 changed files with 60 additions and 7 deletions

View File

@ -94,7 +94,24 @@ func (gui *Gui) refreshCommitFilesView() error {
}
isStash := gui.State.Panels.CommitFiles.refType == REF_TYPE_STASH
files, err := gui.GitCommand.GetFilesInRef(gui.State.Panels.CommitFiles.refName, isStash, gui.GitCommand.PatchManager)
refName := gui.State.Panels.CommitFiles.refName
diffing := gui.State.Modes.Diffing
var files []*commands.CommitFile
var err error
if diffing.Active() {
from := diffing.Ref
to := refName
if diffing.Reverse {
from, to = to, from
}
files, err = gui.GitCommand.GetFilesInDiff(from, to, refName, gui.GitCommand.PatchManager)
} else {
files, err = gui.GitCommand.GetFilesInRef(refName, isStash, gui.GitCommand.PatchManager)
}
if err != nil {
return gui.surfaceError(err)
}