Use non-sticky range diff when entering commit files panel

We make the name of the GetSelectedRefRangeForDiffFiles very specific on purpose
to make it clear that this is only for switching to diff files, so the
implementations can make assumptions about that (unlike GetSelectedRef, which is
used for different purposes and needs to stay more generic).
This commit is contained in:
Stefan Haller 2024-08-23 20:55:37 +02:00
parent a6656e307c
commit ef7d1a8602
8 changed files with 81 additions and 25 deletions

View file

@ -73,9 +73,8 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt
return nil
}
ref := self.c.Contexts().CommitFiles.CommitFileTreeViewModel.GetRef()
to := ref.RefName()
from, reverse := self.c.Modes().Diffing.GetFromAndReverseArgsForDiff(ref.ParentRefName())
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