mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
allow getting the current item generically
This commit is contained in:
@ -16,3 +16,7 @@ type Branch struct {
|
||||
func (b *Branch) RefName() string {
|
||||
return b.Name
|
||||
}
|
||||
|
||||
func (b *Branch) ID() string {
|
||||
return b.RefName()
|
||||
}
|
||||
|
@ -28,3 +28,7 @@ func (c *Commit) NameWithSha() string {
|
||||
func (c *Commit) RefName() string {
|
||||
return c.Sha
|
||||
}
|
||||
|
||||
func (c *Commit) ID() string {
|
||||
return c.RefName()
|
||||
}
|
||||
|
@ -7,3 +7,7 @@ type CommitFile struct {
|
||||
DisplayString string
|
||||
Status int // one of 'WHOLE' 'PART' 'NONE'
|
||||
}
|
||||
|
||||
func (f *CommitFile) ID() string {
|
||||
return f.Name
|
||||
}
|
||||
|
@ -10,3 +10,7 @@ type Remote struct {
|
||||
func (r *Remote) RefName() string {
|
||||
return r.Name
|
||||
}
|
||||
|
||||
func (r *Remote) ID() string {
|
||||
return r.RefName()
|
||||
}
|
||||
|
@ -13,3 +13,7 @@ func (r *RemoteBranch) FullName() string {
|
||||
func (r *RemoteBranch) RefName() string {
|
||||
return r.FullName()
|
||||
}
|
||||
|
||||
func (r *RemoteBranch) ID() string {
|
||||
return r.RefName()
|
||||
}
|
||||
|
@ -11,3 +11,7 @@ type StashEntry struct {
|
||||
func (s *StashEntry) RefName() string {
|
||||
return fmt.Sprintf("stash@{%d}", s.Index)
|
||||
}
|
||||
|
||||
func (s *StashEntry) ID() string {
|
||||
return s.RefName()
|
||||
}
|
||||
|
@ -8,3 +8,7 @@ type Tag struct {
|
||||
func (t *Tag) RefName() string {
|
||||
return t.Name
|
||||
}
|
||||
|
||||
func (t *Tag) ID() string {
|
||||
return t.RefName()
|
||||
}
|
||||
|
Reference in New Issue
Block a user