mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Store fromHash/toHash in Pipe struct as pointers
Now that commit hashes are stored in a pool and referenced by pointer by the commits, we can use those same pointers in the pipes.
This commit is contained in:
parent
8d834e2eab
commit
13c21365c0
7 changed files with 126 additions and 112 deletions
|
@ -93,6 +93,10 @@ func (c *Commit) Hash() string {
|
|||
return *c.hash
|
||||
}
|
||||
|
||||
func (c *Commit) HashPtr() *string {
|
||||
return c.hash
|
||||
}
|
||||
|
||||
func (c *Commit) ShortHash() string {
|
||||
return utils.ShortHash(c.Hash())
|
||||
}
|
||||
|
@ -120,6 +124,10 @@ func (c *Commit) Parents() []string {
|
|||
return lo.Map(c.parents, func(s *string, _ int) string { return *s })
|
||||
}
|
||||
|
||||
func (c *Commit) ParentPtrs() []*string {
|
||||
return c.parents
|
||||
}
|
||||
|
||||
func (c *Commit) IsFirstCommit() bool {
|
||||
return len(c.parents) == 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue