1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

faster patch manager

This commit is contained in:
Jesse Duffield
2020-08-22 16:46:19 +10:00
parent c837c54c39
commit 12bf851c7d
5 changed files with 113 additions and 54 deletions

View File

@ -144,7 +144,7 @@ func NewGitCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Localizer,
PushToCurrent: pushToCurrent,
}
gitCommand.PatchManager = patch.NewPatchManager(log, gitCommand.ApplyPatch)
gitCommand.PatchManager = patch.NewPatchManager(log, gitCommand.ApplyPatch, gitCommand.ShowCommitFile)
return gitCommand, nil
}
@ -1077,7 +1077,12 @@ func (c *GitCommand) GetCommitFilesFromFilenames(filenames string, parent string
for _, file := range strings.Split(strings.TrimRight(filenames, "\n"), "\n") {
status := patch.UNSELECTED
if patchManager != nil && patchManager.Parent == parent {
status = patchManager.GetFileStatus(file)
var err error
status, err = patchManager.GetFileStatus(file)
if err != nil {
c.Log.Error(err)
continue
}
}
commitFiles = append(commitFiles, &CommitFile{