1
0
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:
Jesse Duffield
2020-08-22 09:01:14 +10:00
parent 974c6510b8
commit 0ac402792b
9 changed files with 49 additions and 31 deletions

View File

@ -16,3 +16,7 @@ type Branch struct {
func (b *Branch) RefName() string {
return b.Name
}
func (b *Branch) ID() string {
return b.RefName()
}

View File

@ -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()
}

View File

@ -7,3 +7,7 @@ type CommitFile struct {
DisplayString string
Status int // one of 'WHOLE' 'PART' 'NONE'
}
func (f *CommitFile) ID() string {
return f.Name
}

View File

@ -10,3 +10,7 @@ type Remote struct {
func (r *Remote) RefName() string {
return r.Name
}
func (r *Remote) ID() string {
return r.RefName()
}

View File

@ -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()
}

View File

@ -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()
}

View File

@ -8,3 +8,7 @@ type Tag struct {
func (t *Tag) RefName() string {
return t.Name
}
func (t *Tag) ID() string {
return t.RefName()
}