1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

some more standardisation for diffing

This commit is contained in:
Jesse Duffield
2020-08-19 22:57:22 +10:00
parent 2855b5b4d5
commit 7561f5aa32
7 changed files with 60 additions and 48 deletions

View File

@ -12,3 +12,7 @@ type Branch struct {
UpstreamName string
Head bool
}
func (b *Branch) RefName() string {
return b.Name
}

View File

@ -24,3 +24,7 @@ func (c *Commit) ShortSha() string {
func (c *Commit) NameWithSha() string {
return fmt.Sprintf("%s %s", c.Sha[:7], c.Name)
}
func (c *Commit) RefName() string {
return c.Sha
}

View File

@ -6,3 +6,7 @@ type Remote struct {
Urls []string
Branches []*RemoteBranch
}
func (r *Remote) RefName() string {
return r.Name
}

View File

@ -9,3 +9,7 @@ type RemoteBranch struct {
func (r *RemoteBranch) FullName() string {
return r.RemoteName + "/" + r.Name
}
func (r *RemoteBranch) RefName() string {
return r.FullName()
}

View File

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