mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
bug: add snapshot.SearchComment method
This commit is contained in:
parent
e012b6c622
commit
d34eae189c
@ -70,6 +70,17 @@ func (snap *Snapshot) SearchTimelineItem(hash git.Hash) (TimelineItem, error) {
|
||||
return nil, fmt.Errorf("timeline item not found")
|
||||
}
|
||||
|
||||
// SearchComment will search for a comment matching the given hash
|
||||
func (snap *Snapshot) SearchComment(hash git.Hash) (*Comment, error) {
|
||||
for _, c := range snap.Comments {
|
||||
if c.id == hash.String() {
|
||||
return &c, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("comment item not found")
|
||||
}
|
||||
|
||||
// append the operation author to the actors list
|
||||
func (snap *Snapshot) addActor(actor identity.Interface) {
|
||||
for _, a := range snap.Actors {
|
||||
|
Loading…
Reference in New Issue
Block a user