1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +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:
Stefan Haller
2025-04-15 14:57:40 +02:00
parent 8d834e2eab
commit 13c21365c0
7 changed files with 126 additions and 112 deletions

View File

@@ -46,11 +46,11 @@ func NewSubCommitsContext(
return [][]string{}
}
selectedCommitHash := ""
var selectedCommitHashPtr *string
if c.Context().Current().GetKey() == SUB_COMMITS_CONTEXT_KEY {
selectedCommit := viewModel.GetSelected()
if selectedCommit != nil {
selectedCommitHash = selectedCommit.Hash()
selectedCommitHashPtr = selectedCommit.HashPtr()
}
}
branches := []*models.Branch{}
@@ -72,7 +72,7 @@ func NewSubCommitsContext(
c.UserConfig().Gui.ShortTimeFormat,
time.Now(),
c.UserConfig().Git.ParseEmoji,
selectedCommitHash,
selectedCommitHashPtr,
startIdx,
endIdx,
shouldShowGraph(c),