mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user