diff --git a/pkg/gui/controllers/helpers/patch_building_helper.go b/pkg/gui/controllers/helpers/patch_building_helper.go index 7b7037b46..df107ed9b 100644 --- a/pkg/gui/controllers/helpers/patch_building_helper.go +++ b/pkg/gui/controllers/helpers/patch_building_helper.go @@ -55,7 +55,7 @@ func (self *PatchBuildingHelper) Reset() error { return self.c.PostRefreshUpdate(self.c.Context().Current()) } -func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpts) error { +func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpts) { selectedLineIdx := -1 if opts.ClickedWindowName == "main" { selectedLineIdx = opts.ClickedViewLineIdx @@ -63,20 +63,20 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt if !self.c.Git().Patch.PatchBuilder.Active() { self.Escape() - return nil + return } // get diff from commit file that's currently selected path := self.c.Contexts().CommitFiles.GetSelectedPath() if path == "" { - return nil + return } from, to := self.c.Contexts().CommitFiles.GetFromAndToForDiff() from, reverse := self.c.Modes().Diffing.GetFromAndReverseArgsForDiff(from) diff, err := self.c.Git().WorkingTree.ShowFileDiff(from, to, reverse, path, true) if err != nil { - return err + return } secondaryDiff := self.c.Git().Patch.PatchBuilder.RenderPatchForFile(patch.RenderPatchForFileOpts{ @@ -94,7 +94,7 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt context.SetState(state) if state == nil { self.Escape() - return nil + return } mainContent := context.GetContentToRender(true) @@ -112,6 +112,4 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt Title: self.c.Tr.CustomPatch, }, }) - - return nil } diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index 4e4e444ec..2a0c93f52 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -180,7 +180,7 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error { } if scopeSet.Includes(types.PATCH_BUILDING) { - refresh("patch building", func() { _ = self.patchBuildingHelper.RefreshPatchBuildingPanel(types.OnFocusOpts{}) }) + refresh("patch building", func() { self.patchBuildingHelper.RefreshPatchBuildingPanel(types.OnFocusOpts{}) }) } if scopeSet.Includes(types.MERGE_CONFLICTS) || scopeSet.Includes(types.FILES) { diff --git a/pkg/gui/controllers/patch_building_controller.go b/pkg/gui/controllers/patch_building_controller.go index ffd09b3d0..9b6568016 100644 --- a/pkg/gui/controllers/patch_building_controller.go +++ b/pkg/gui/controllers/patch_building_controller.go @@ -67,9 +67,7 @@ func (self *PatchBuildingController) GetOnFocus() func(types.OnFocusOpts) { // no need to change wrap on the secondary view because it can't be interacted with self.c.Views().PatchBuilding.Wrap = false - // Swallowing the error here for now. This will change shortly to not - // return an error any more. - _ = self.c.Helpers().PatchBuilding.RefreshPatchBuildingPanel(opts) // FIXME + self.c.Helpers().PatchBuilding.RefreshPatchBuildingPanel(opts) } }