MCPcopy
hub / github.com/jesseduffield/lazygit / setCommitStatuses

Function setCommitStatuses

pkg/commands/git_commands/commit_loader.go:544–560  ·  view source on GitHub ↗
(unpushedCommitHashes *set.Set[string], unmergedCommitHashes *set.Set[string], commits []*models.Commit)

Source from the content-addressed store, hash-verified

542}
543
544func setCommitStatuses(unpushedCommitHashes *set.Set[string], unmergedCommitHashes *set.Set[string], commits []*models.Commit) {
545 for i, commit := range commits {
546 if commit.IsTODO() {
547 continue
548 }
549
550 if unmergedCommitHashes == nil || unmergedCommitHashes.Includes(commit.Hash()) {
551 if unpushedCommitHashes != nil && unpushedCommitHashes.Includes(commit.Hash()) {
552 commits[i].Status = models.StatusUnpushed
553 } else {
554 commits[i].Status = models.StatusPushed
555 }
556 } else {
557 commits[i].Status = models.StatusMerged
558 }
559 }
560}
561
562func (self *CommitLoader) getReachableHashes(refName string, notRefNames []string) *set.Set[string] {
563 output, _, err := self.cmd.New(

Callers 2

GetCommitsMethod · 0.85

Calls 2

IsTODOMethod · 0.80
HashMethod · 0.45

Tested by 1