From 4835fc00b861c6117c1d4d6873a05d808e54b4cf Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sat, 26 Mar 2022 22:18:08 +0900 Subject: introduce Ref interface --- pkg/gui/context/sub_commits_context.go | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'pkg/gui/context/sub_commits_context.go') diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go index ffc053267..d9a1e7c6b 100644 --- a/pkg/gui/context/sub_commits_context.go +++ b/pkg/gui/context/sub_commits_context.go @@ -82,16 +82,8 @@ func (self *SubCommitsContext) CanRebase() bool { return false } -// not to be confused with the refName in the view model. This is the ref name of -// the selected commit -func (self *SubCommitsContext) GetSelectedRefName() string { - item := self.GetSelected() - - if item == nil { - return "" - } - - return item.RefName() +func (self *SubCommitsContext) GetSelectedRef() types.Ref { + return self.GetSelected() } func (self *SubCommitsContext) GetCommits() []*models.Commit { @@ -101,13 +93,3 @@ func (self *SubCommitsContext) GetCommits() []*models.Commit { func (self *SubCommitsContext) Title() string { return fmt.Sprintf(self.c.Tr.SubCommitsDynamicTitle, utils.TruncateWithEllipsis(self.refName, 50)) } - -func (self *SubCommitsContext) GetSelectedDescription() string { - item := self.GetSelected() - - if item == nil { - return "" - } - - return item.Description() -} -- cgit v1.2.3