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

Function NewCommit

pkg/commands/models/commit.go:82–97  ·  view source on GitHub ↗
(hashPool *utils.StringPool, opts NewCommitOpts)

Source from the content-addressed store, hash-verified

80}
81
82func NewCommit(hashPool *utils.StringPool, opts NewCommitOpts) *Commit {
83 return &Commit{
84 hash: hashPool.Add(opts.Hash),
85 Name: opts.Name,
86 Status: opts.Status,
87 Action: opts.Action,
88 ActionFlag: opts.ActionFlag,
89 Tags: opts.Tags,
90 ExtraInfo: opts.ExtraInfo,
91 AuthorName: opts.AuthorName,
92 AuthorEmail: opts.AuthorEmail,
93 UnixTimestamp: opts.UnixTimestamp,
94 Divergence: opts.Divergence,
95 parents: lo.Map(opts.Parents, func(s string, _ int) *string { return hashPool.Add(s) }),
96 }
97}
98
99func (c *Commit) Hash() string {
100 return *c.hash

Calls 1

AddMethod · 0.45