From 6ea6f3614e46a62f4a37c6afb488547a3d548191 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 1 Oct 2018 23:31:16 +0200 Subject: bug: in op convenience function, return the new op to be able to set metadata later --- bug/op_label_change.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bug/op_label_change.go') 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 { -- cgit