diff options
author | Michael Muré <batolettre@gmail.com> | 2018-10-01 23:31:16 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-10-01 23:31:16 +0200 |
commit | 6ea6f3614e46a62f4a37c6afb488547a3d548191 (patch) | |
tree | 8a32431ce90dd8b169aac858b99a761b8f76c95f /bug/op_label_change.go | |
parent | f026f61aaaa7b9e579e99f171f7fefb38c4c6181 (diff) | |
download | git-bug-6ea6f3614e46a62f4a37c6afb488547a3d548191.tar.gz |
bug: in op convenience function, return the new op to be able to set metadata later
Diffstat (limited to 'bug/op_label_change.go')
-rw-r--r-- | bug/op_label_change.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bug/op_label_change.go b/bug/op_label_change.go index 006afd88..b7957b86 100644 --- a/bug/op_label_change.go +++ b/bug/op_label_change.go @@ -118,7 +118,7 @@ func (l LabelChangeTimelineItem) Hash() git.Hash { } // ChangeLabels is a convenience function to apply the operation -func ChangeLabels(b Interface, author Person, unixTime int64, add, remove []string) ([]LabelChangeResult, error) { +func ChangeLabels(b Interface, author Person, unixTime int64, add, remove []string) ([]LabelChangeResult, *LabelChangeOperation, error) { var added, removed []Label var results []LabelChangeResult @@ -163,18 +163,18 @@ func ChangeLabels(b Interface, author Person, unixTime int64, add, remove []stri } if len(added) == 0 && len(removed) == 0 { - return results, fmt.Errorf("no label added or removed") + return results, nil, fmt.Errorf("no label added or removed") } labelOp := NewLabelChangeOperation(author, unixTime, added, removed) if err := labelOp.Validate(); err != nil { - return nil, err + return nil, nil, err } b.Append(labelOp) - return results, nil + return results, labelOp, nil } func labelExist(labels []Label, label Label) bool { |