MCPcopy Index your code
hub / github.com/git-bug/git-bug / NewBugExcerpt

Function NewBugExcerpt

cache/bug_excerpt.go:40–69  ·  view source on GitHub ↗
(b *BugCache)

Source from the content-addressed store, hash-verified

38}
39
40func NewBugExcerpt(b *BugCache) *BugExcerpt {
41 snap := b.Snapshot()
42 participantsIds := make([]entity.Id, 0, len(snap.Participants))
43 for _, participant := range snap.Participants {
44 participantsIds = append(participantsIds, participant.Id())
45 }
46
47 actorsIds := make([]entity.Id, 0, len(snap.Actors))
48 for _, actor := range snap.Actors {
49 actorsIds = append(actorsIds, actor.Id())
50 }
51
52 e := &BugExcerpt{
53 id: b.Id(),
54 CreateLamportTime: b.CreateLamportTime(),
55 EditLamportTime: b.EditLamportTime(),
56 CreateUnixTime: b.FirstOp().Time().Unix(),
57 EditUnixTime: snap.EditTime().Unix(),
58 AuthorId: snap.Author.Id(),
59 Status: snap.Status,
60 Labels: snap.Labels,
61 Actors: actorsIds,
62 Participants: participantsIds,
63 Title: snap.Title,
64 LenComments: len(snap.Comments),
65 CreateMetadata: b.FirstOp().AllMetadata(),
66 }
67
68 return e
69}
70
71func (b *BugExcerpt) setId(id entity.Id) {
72 b.id = id

Callers

nothing calls this directly

Calls 8

SnapshotMethod · 0.80
IdMethod · 0.65
CreateLamportTimeMethod · 0.65
EditLamportTimeMethod · 0.65
TimeMethod · 0.65
FirstOpMethod · 0.65
AllMetadataMethod · 0.65
EditTimeMethod · 0.45

Tested by

no test coverage detected